Commit dadabcb6 authored by Paul Rich's avatar Paul Rich
Browse files

Merge branch 'revert-0f6338a7' into 'develop'

Revert "Merge branch 'revert-fe04ae24' into 'develop'"

See merge request !65
parents 11138ae0 52c5e1e7
...@@ -190,12 +190,13 @@ def extract_system_node_data(node_data): ...@@ -190,12 +190,13 @@ def extract_system_node_data(node_data):
return ret_nodeinfo return ret_nodeinfo
def fetch_ssd_static_data(nid_list=None, by_cname=False): def fetch_ssd_static_data(nid_list=None, raw=False):
'''Get static SSD information from CAPMC. '''Get static SSD information from CAPMC.
Args: Args:
nid_list - optional list of nodes as a comma-delimited, hyphenated string (default None). nid_list - optional list of nodes as a comma-delimited, hyphenated string (default None).
by_cname - if True, returns the nodes keyed by Cray cname (default False raw - If True returns raw json dict. If False, adds nid indexing (default False)
Returns: Returns:
A dictionary with call status, Consult CAPMC documentation for details A dictionary with call status, Consult CAPMC documentation for details
...@@ -207,17 +208,16 @@ def fetch_ssd_static_data(nid_list=None, by_cname=False): ...@@ -207,17 +208,16 @@ def fetch_ssd_static_data(nid_list=None, by_cname=False):
if nid_list is not None: if nid_list is not None:
args.extend(['-n', nid_list]) args.extend(['-n', nid_list])
ret_info = _call_sys_forker_capmc(CAPMC_PATH, args) ret_info = _call_sys_forker_capmc(CAPMC_PATH, args)
if not by_cname: if not raw:
# Because everything else in this system works on nids. # Because everything else in this system works on nids.
fixed_ret_info = {} fixed_ret_info = {}
fixed_ret_info = {'e': ret_info['e'],
'err_msg': ret_info['err_msg']}
fixed_ret_info['nids'] = [] fixed_ret_info['nids'] = []
for key, val in ret_info.items(): for key, val in ret_info.items():
if key not in ['e', 'err_msg']: if key not in ['e', 'err_msg']:
fixed_val = val for ssd_info in val: # This is a list of SSDs potentially
val['cname'] = key fixed_ret_info['nids'].append(ssd_info)
fixed_ret_info['nids'].append(fixed_val)
else:
fixed_ret_info[key] = val
ret_info = fixed_ret_info ret_info = fixed_ret_info
return ret_info return ret_info
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment