mirror of
https://github.com/CumulusNetworks/ifupdown2.git
synced 2024-05-06 15:54:50 +00:00
ifupdown2: syntax-check: exit with 1 if syntax errors
Ticket: CM-7995 Reviewed By: CCR-3850 Testing Done: Tested exit code on syntax errors This patch adds members 'errors' and 'warns' to networkinterfaces.py to track errors and warns during parsing interfaces file. This patch also adds --syntax-check option to ifreload given people seem to use ifreload more than ifup these days. $ ifreload --syntax-check -a error: /etc/network/interfaces: iface swp1.200: unsupported keyword (roopa-attr) $ echo $? 1 (cherry picked from commit e643a136fcf5d387ff0f9a31cb6a6af4983e1012)
This commit is contained in:
committed by
Sam Tannous
parent
ff28a49e7d
commit
cfa06db648
@@ -14,7 +14,7 @@ reload network interface configuration
|
||||
|
||||
SYNOPSIS
|
||||
========
|
||||
ifreload [-h] (-a|-c) [-v] [-d] [-f] [-n]
|
||||
ifreload [-h] (-a|-c) [-v] [-d] [-f] [-n] [-s]
|
||||
|
||||
DESCRIPTION
|
||||
===========
|
||||
@@ -61,6 +61,8 @@ OPTIONS
|
||||
then each dependent interface must be specified in order
|
||||
to be excluded.
|
||||
|
||||
-s, --syntax-check Only run the interfaces file parser
|
||||
|
||||
|
||||
EXAMPLES
|
||||
========
|
||||
|
@@ -22,7 +22,7 @@ SYNOPSIS
|
||||
========
|
||||
|
||||
ifup [-h] [-a] [-v] [-d] [--allow CLASS] [--with-depends]
|
||||
**[-X EXCLUDEPATS] [-f] [-n] [--print-dependency {list,dot}]**
|
||||
**[-X EXCLUDEPATS] [-f] [-n] [-s] [--print-dependency {list,dot}]**
|
||||
**[IFACE [IFACE ...]]**
|
||||
|
||||
ifdown [-h] [-a] [-v] [-d] [--allow CLASS] [--with-depends]
|
||||
@@ -115,6 +115,8 @@ OPTIONS
|
||||
your state file is corrupted or you want down to use
|
||||
the latest from the interfaces file
|
||||
|
||||
-s, --syntax-check Only run the interfaces file parser
|
||||
|
||||
EXAMPLES
|
||||
========
|
||||
# bringing up all interfaces
|
||||
|
Reference in New Issue
Block a user