6
6
import pprint
7
7
import time
8
8
9
- from lib import YnlFamily
9
+ from lib import YnlFamily , Netlink
10
10
11
11
12
12
def main ():
@@ -19,6 +19,14 @@ def main():
19
19
parser .add_argument ('--dump' , dest = 'dump' , type = str )
20
20
parser .add_argument ('--sleep' , dest = 'sleep' , type = int )
21
21
parser .add_argument ('--subscribe' , dest = 'ntf' , type = str )
22
+ parser .add_argument ('--replace' , dest = 'flags' , action = 'append_const' ,
23
+ const = Netlink .NLM_F_REPLACE )
24
+ parser .add_argument ('--excl' , dest = 'flags' , action = 'append_const' ,
25
+ const = Netlink .NLM_F_EXCL )
26
+ parser .add_argument ('--create' , dest = 'flags' , action = 'append_const' ,
27
+ const = Netlink .NLM_F_CREATE )
28
+ parser .add_argument ('--append' , dest = 'flags' , action = 'append_const' ,
29
+ const = Netlink .NLM_F_APPEND )
22
30
args = parser .parse_args ()
23
31
24
32
if args .no_schema :
@@ -37,7 +45,7 @@ def main():
37
45
time .sleep (args .sleep )
38
46
39
47
if args .do :
40
- reply = ynl .do (args .do , attrs )
48
+ reply = ynl .do (args .do , attrs , args . flags )
41
49
pprint .PrettyPrinter ().pprint (reply )
42
50
if args .dump :
43
51
reply = ynl .dump (args .dump , attrs )
0 commit comments