Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge mgmt-framework bug fixes from Dell - 12th Sept #111

Merged
merged 2 commits into from
Sep 12, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/CLI/actioner/sonic-cli-pfm.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,18 @@ def run(func, args):

else :
api_response = getattr(aa,func.__name__)(*keypath)

if api_response is None:
print ("Success")
else:
response = api_response.to_dict()
value = response['openconfig_platformcomponents']['component'][0]['state']
if value is None:
api_response = aa.api_client.sanitize_for_serialization(api_response)
value = api_response['openconfig-platform:components']['component'][0]['state']
if value is None:
return
if 'oper-status' in value:
temp = value['oper-status'].split(':')
if temp[len(temp) - 1] is not None:
value['oper-status'] = temp[len(temp) - 1]
show_cli_output(sys.argv[2],filter_json_value(value))

except ApiException as e:
Expand Down
6 changes: 2 additions & 4 deletions src/CLI/actioner/sonic-cli-sys.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,9 @@ def run(func, args):
try:
if body is not None:
api_response = getattr(aa,func.__name__)(*keypath, body=body)

else :
api_response = getattr(aa,func.__name__)(*keypath)
#print(api_response)
if api_response is None:
print ("Success")
else:
Expand All @@ -105,7 +104,7 @@ def run(func, args):
show_cli_output(sys.argv[2], value['cpu'])
elif 'openconfig_systemprocesses' in response.keys():
value = response['openconfig_systemprocesses']
if len(sys.argv) < 4:
if 'pid' not in sys.argv:
if value is None:
return
show_cli_output(sys.argv[2],value['process'])
Expand All @@ -114,7 +113,6 @@ def run(func, args):
if proc['pid'] == int(sys.argv[3]):
show_cli_output(sys.argv[2],util_capitalize(proc['state']))
return
print("command works")
else:
print("Failed")
except ApiException as e:
Expand Down
2 changes: 1 addition & 1 deletion src/CLI/clitree/scripts/platform_dummy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@
<ENTITYNAME value="32">MAX_PORT_ID</ENTITYNAME>
<ENTITYNAME value="1">START_SUB_PORT_ID</ENTITYNAME>
<ENTITYNAME value="4">MAX_SUB_PORT_ID</ENTITYNAME>
<ENTITYNAME value="9276">MAX_MTU</ENTITYNAME>
<ENTITYNAME value="9216">MAX_MTU</ENTITYNAME>
</ENTITYLIST>
</PLATFORMMODULE>
Loading