Ejemplo n.º 1
0
    def __init__(self, config, version='1.3.2'):
        self._config_template = config
        self.services = []
        self.configurations = {}
        self.node_groups = {}
        self.version = version
        self.user_input_handlers = {}

        cluster_template = json.loads(config)
        self._parse_services(cluster_template)
        self._parse_configurations(cluster_template)
        self._process_node_groups(template_json=cluster_template)
Ejemplo n.º 2
0
    def __init__(self, config, version='1.3.2'):
        self._config_template = config
        self.services = []
        self.configurations = {}
        self.node_groups = {}
        self.version = version
        self.user_input_handlers = {}

        cluster_template = json.loads(config)
        self._parse_services(cluster_template)
        self._parse_configurations(cluster_template)
        self._process_node_groups(template_json=cluster_template)
Ejemplo n.º 3
0
    def create_operational_config(self, cluster, user_inputs,
                                  scaled_groups=None):
        if scaled_groups is None:
            scaled_groups = {}
        self._determine_deployed_services(cluster)
        self._process_node_groups(cluster=cluster)

        for ng_id in scaled_groups:
            existing = next(group for group in self.node_groups.values()
                            if group.id == ng_id)
            existing.count = scaled_groups[ng_id]

        self.validate_node_groups(cluster)
        self._finalize_ng_components()
        self._parse_configurations(json.loads(self._config_template))
        self._process_user_inputs(user_inputs)
        self._replace_config_tokens()
Ejemplo n.º 4
0
    def create_operational_config(self,
                                  cluster,
                                  user_inputs,
                                  scaled_groups=None):
        if scaled_groups is None:
            scaled_groups = {}
        self._determine_deployed_services(cluster)
        self._process_node_groups(cluster=cluster)

        for ng_id in scaled_groups:
            existing = next(group for group in self.node_groups.values()
                            if group.id == ng_id)
            existing.count = scaled_groups[ng_id]

        self.validate_node_groups(cluster)
        self._finalize_ng_components()
        self._parse_configurations(json.loads(self._config_template))
        self._process_user_inputs(user_inputs)
        self._replace_config_tokens()
Ejemplo n.º 5
0
 def _from_json(self, datastring):
     try:
         return jsonutils.loads(datastring)
     except ValueError:
         msg = _("cannot understand JSON")
         raise exception.MalformedRequestBody(reason=msg)
Ejemplo n.º 6
0
 def process_result_value(self, value, dialect):
     if value is not None:
         value = jsonutils.loads(value)
     return value