44from .. import pxe
55from marmoset import config as config_reader
66
7- config = config_reader .load_config ()
8- immutable_pxe_config_support = config ['PXEConfig' ].get ('ImmutableSupport' )
7+ CONFIG = config_reader .load_config ()
8+ IMMUTABLE_PXE_CONFIG_SUPPORT = CONFIG ['PXEConfig' ].get ('ImmutableSupport' )
99
10- parser = reqparse .RequestParser ()
11- parser .add_argument ('ip_address' , type = str )
12- parser .add_argument ('password' , type = str , default = None )
13- parser .add_argument ('script' , type = str , default = None )
14- parser .add_argument ('uuid' , type = str , default = None )
15- parser .add_argument ('ipv6_address' , type = str , default = None )
16- parser .add_argument ('ipv6_gateway' , type = str , default = None )
17- parser .add_argument ('ipv6_prefix' , type = str , default = None )
18- parser .add_argument (
10+ PARSER = reqparse .RequestParser ()
11+ PARSER .add_argument ('ip_address' , type = str )
12+ PARSER .add_argument ('password' , type = str , default = None )
13+ PARSER .add_argument ('script' , type = str , default = None )
14+ PARSER .add_argument ('uuid' , type = str , default = None )
15+ PARSER .add_argument ('ipv6_address' , type = str , default = None )
16+ PARSER .add_argument ('ipv6_gateway' , type = str , default = None )
17+ PARSER .add_argument ('ipv6_prefix' , type = str , default = None )
18+ PARSER .add_argument (
1919 'label' ,
2020 type = str ,
2121 choices = pxe .Label .names (),
2222 default = pxe .Label .names ()[0 ])
2323
24- if immutable_pxe_config_support == 'True' :
25- persistent_choices = ['true' , 'True' , 'false' , 'False' ]
24+ if IMMUTABLE_PXE_CONFIG_SUPPORT == 'True' :
25+ PERSISTENT_CHOICES = ['true' , 'True' , 'false' , 'False' ]
2626else :
27- persistent_choices = ['false' , 'False' ]
28- parser .add_argument ('persistent' , choices = persistent_choices ,
27+ PERSISTENT_CHOICES = ['false' , 'False' ]
28+ PARSER .add_argument ('persistent' , choices = PERSISTENT_CHOICES ,
2929 type = str , default = 'false' )
3030
3131
@@ -45,7 +45,7 @@ def post(self):
4545 only when all of them are provided. Missing password or uuid will
4646 be auto generated by ClientConfig.
4747 """
48- args = parser .parse_args ()
48+ args = PARSER .parse_args ()
4949
5050 persistent = args .persistent in ['true' , 'True' ]
5151 print (args )
0 commit comments