lf_json_autogen.py: fixes warning about possibly undeclared variable

Signed-off-by: Jed Reynolds <jed@candelatech.com>
This commit is contained in:
Jed Reynolds
2021-09-10 14:43:04 -07:00
parent 4994d658fd
commit ff6d19fe8f

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env python3
"""----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
Generated by LANforge JsonApiPythonGenerator, Fri Sep 10 14:30:41 PDT 2021
Generated by LANforge JsonApiPythonGenerator, Fri Sep 10 14:38:00 PDT 2021
- - WORK IN PROGRESS - -
The API this library provides is actively being changed.
This file expects to live in py-json/LANforge directory.
@@ -2389,7 +2389,7 @@ class LFJsonPost(LFCliBase):
@staticmethod
def set_flags(flag_class: IntFlag, starting_value: int, flag_names=None):
"""----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----
Example Usage:
Example Usage:
value = LFJsonPost.add_flags(SetPortMumble, 0, flag_names=['bridge', 'dhcp'])
print('value now: '+value)
----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- ----- -----"""
@@ -2434,6 +2434,7 @@ class LFJsonPost(LFCliBase):
raise ValueError("starting_value should be an integer greater than zero and not None")
if not flag_names:
raise ValueError("flag_names should be a name or a list of names, not None")
unselected_val = None
if type(flag_names) is list:
unselected_val = starting_value
for flag in flag_names: