mirror of
https://github.com/Telecominfraproject/wlan-lanforge-scripts.git
synced 2025-11-03 20:27:54 +00:00
JSON: adds guards to createGenEndp
This commit is contained in:
@@ -13,11 +13,16 @@ class GenericCx(LFCliBase):
|
|||||||
self.lfclient_host = lfclient_host
|
self.lfclient_host = lfclient_host
|
||||||
self.lfclient_port = lfclient_port
|
self.lfclient_port = lfclient_port
|
||||||
|
|
||||||
def createGenEndp(self, alias, shelf, rsrc, port, type):
|
def createGenEndp(self, alias=None, shelf=1, resource=1, port=None, type=None):
|
||||||
|
if port is None:
|
||||||
|
raise ValueError("createGenEndp: port required")
|
||||||
|
if type is None:
|
||||||
|
raise ValueError("createGenEndp: type required")
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
"alias": alias,
|
"alias": alias,
|
||||||
"shelf": shelf,
|
"shelf": shelf,
|
||||||
"resource": rsrc,
|
"resource": resource,
|
||||||
"port": port,
|
"port": port,
|
||||||
"type": type
|
"type": type
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user