Ejemplo n.º 1
0
 def _extract_pool_policy_mapping_from_config(self, conf_file):
     pools_policy_mapping = {}
     root = storhyper_utils.parse_xml_file(conf_file)
     pools = root.find('pools').findall('*')
     for pool in pools:
         policy = {}
         pool_id = ''
         for child in pool.findall('*'):
             if child.tag == 'pool_id':
                 pool_id = child.text.strip()
             else:
                 policy[child.tag] = child.text.strip()
         pools_policy_mapping[pool_id] = policy
     return pools_policy_mapping
Ejemplo n.º 2
0
 def _extract_pool_policy_mapping_from_config(self, conf_file):
     pools_policy_mapping = {}
     root = storhyper_utils.parse_xml_file(conf_file)
     pools = root.find("pools").findall("*")
     for pool in pools:
         policy = {}
         pool_id = ""
         for child in pool.findall("*"):
             if child.tag == "pool_id":
                 pool_id = child.text.strip()
             else:
                 policy[child.tag] = child.text.strip()
         pools_policy_mapping[pool_id] = policy
     return pools_policy_mapping
Ejemplo n.º 3
0
 def _update_default_volume_stats_from_config(self, default_volume_stats, config_file):
     root = storhyper_utils.parse_xml_file(config_file)
     for child in root.find("policy").findall("*"):
         if child.tag == "QoS_support":
             if child.text.strip() == "0":
                 default_volume_stats[child.tag] = False
             else:
                 default_volume_stats[child.tag] = True
         else:
             default_volume_stats[child.tag] = child.text.strip()
     for child in root.find("capability").findall("*"):
         default_volume_stats[child.tag] = child.text.strip()
     pools = root.find("pools").findall("*")
     for pool in pools:
         for child in pool.findall("*"):
             childtext = child.text.strip()
             if child.tag == "pool_id" and len(childtext) > 0:
                 default_volume_stats["pools_id"].append(childtext)
Ejemplo n.º 4
0
 def _update_default_volume_stats_from_config(self, default_volume_stats,
                                              config_file):
     root = storhyper_utils.parse_xml_file(config_file)
     for child in root.find('policy').findall('*'):
         if child.tag == 'QoS_support':
             if child.text.strip() == '0':
                 default_volume_stats[child.tag] = False
             else:
                 default_volume_stats[child.tag] = True
         else:
             default_volume_stats[child.tag] = child.text.strip()
     for child in root.find('capability').findall('*'):
         default_volume_stats[child.tag] = child.text.strip()
     pools = root.find('pools').findall('*')
     for pool in pools:
         for child in pool.findall('*'):
             childtext = child.text.strip()
             if child.tag == 'pool_id' and len(childtext) > 0:
                 default_volume_stats['pools_id'].append(childtext)
Ejemplo n.º 5
0
 def _update_default_volume_stats_from_config(self,
                                              default_volume_stats,
                                              config_file):
         root = storhyper_utils.parse_xml_file(config_file)
         for child in root.find('policy').findall('*'):
             if child.tag == 'QoS_support':
                 if child.text.strip() == '0':
                     default_volume_stats[child.tag] = False
                 else:
                     default_volume_stats[child.tag] = True
             else:
                 default_volume_stats[child.tag] = child.text.strip()
         for child in root.find('capability').findall('*'):
             default_volume_stats[child.tag] = child.text.strip()
         pools = root.find('pools').findall('*')
         for pool in pools:
             for child in pool.findall('*'):
                 childtext = child.text.strip()
                 if child.tag == 'pool_id' and len(childtext) > 0:
                     default_volume_stats['pools_id'].append(childtext)