def __init__(self, instructions, models, controllers):
        super(HTMLDiagramBuilder,
              self).__init__(2.0, instructions, models, controllers,
                             'html-diagram-2.0')
        LOG.info('%s()' % KenLog.fcn())

        self.cloud_desc = self._models['CloudDescription']['cloud']
        self._file_path = ArdanaPaths.get_output_path(self._instructions,
                                                      self.cloud_desc)
        self._file_path = os.path.join(self._file_path, 'html')

        self._cloud_model = self._models['CloudModel']
        self._cloud_version = CloudModel.version(self._cloud_model,
                                                 self._version)
        self._cloud_internal = CloudModel.internal(self._cloud_model)

        self.cloud_name = CloudDescription.get_cloud_name(self.cloud_desc)
        self.control_planes = CloudModel.get(self._cloud_internal,
                                             'control-planes')
        self.iface_models = CloudModel.get(self._cloud_version,
                                           'interface-models')
        self.server_roles = CloudModel.get(self._cloud_version, 'server-roles')
        self.disk_models = CloudModel.get(self._cloud_version, 'disk-models',
                                          [])
        self.memory_models = CloudModel.get(self._cloud_version,
                                            'memory-models', [])
        self.cpu_models = CloudModel.get(self._cloud_version, 'cpu-models', [])
        self.components = CloudModel.get(self._cloud_internal, 'components')
        self.services = CloudModel.get(self._cloud_internal, 'services')
        self.servers = CloudModel.get(self._cloud_internal, 'servers')
        self.server_groups = CloudModel.get(self._cloud_internal,
                                            'server-groups')
        self.network_groups = CloudModel.get(self._cloud_internal,
                                             'network-groups')

        self.region_topology = CloudModel.get(self._cloud_internal,
                                              'region-topology')
        self.service_topology = CloudModel.get(self._cloud_internal,
                                               'service-topology')
        self.cp_topology = CloudModel.get(self._cloud_internal, 'cp-topology')
        self.network_topology = CloudModel.get(self._cloud_internal,
                                               'network-topology')

        self.components_by_mnemonic = {}
        for comp_name, comp_data in self.components.iteritems():
            if 'alias-for' not in comp_data:
                self.components_by_mnemonic[comp_data['mnemonic']] = comp_name

        ArdanaPaths.make_path(self._file_path)
        for subdir in ['Servers']:
            ArdanaPaths.make_path(self._file_path + "/%s" % subdir)

        # Create a mapping from hostname to server id
        self.server_by_hostname = {}
        self.server_by_name = {}
        for s in self.servers:
            if 'hostname' in s:
                self.server_by_hostname[s['hostname']] = s
            if 'name' in s:
                self.server_by_name[s['name']] = s
    def __init__(self, instructions, models, controllers):
        super(AnsibleAllVarsBuilder, self).__init__(
            2.0, instructions, models, controllers,
            'ansible-all-vars-2.0')
        LOG.info('%s()' % KenLog.fcn())
        self.cloud_desc = self._models['CloudDescription']['cloud']
        self._file_path = ArdanaPaths.get_output_path(self._instructions, self.cloud_desc)
        self._file_path = os.path.join(self._file_path, 'ansible')

        self._cloud_model = self._models['CloudModel']
        self._cloud_version = CloudModel.version(self._cloud_model, self._version)
        self._cloud_internal = CloudModel.internal(self._cloud_model)

        ArdanaPaths.make_path(self._file_path)
    def __init__(self, instructions, models, controllers):
        super(RouteInfoBuilder, self).__init__(2.0, instructions, models,
                                               controllers, 'route-info-2.0')
        LOG.info('%s()' % KenLog.fcn())

        self.cloud_desc = self._models['CloudDescription']['cloud']
        self._file_path = ArdanaPaths.get_output_path(self._instructions,
                                                      self.cloud_desc)

        self._cloud_model = self._models['CloudModel']
        self._cloud_version = CloudModel.version(self._cloud_model,
                                                 self._version)
        self._cloud_internal = CloudModel.internal(self._cloud_model)

        ArdanaPaths.make_path(self._file_path)
    def __init__(self, instructions, models, controllers, config_files):
        super(AddressAllocationFinalizer,
              self).__init__(2.0, instructions, models, controllers,
                             config_files, 'address-allocation-2.0')
        LOG.info('%s()' % KenLog.fcn())

        self.cloud_desc = self._models['CloudDescription']['cloud']
        self._file_path = ArdanaPaths.get_output_path(self._instructions,
                                                      self.cloud_desc)
        self._file_path = os.path.join(self._file_path, 'info')

        self._cloud_model = self._models['CloudModel']
        self._cloud_version = CloudModel.version(self._cloud_model,
                                                 self._version)
        self._cloud_internal = CloudModel.internal(self._cloud_model)

        ArdanaPaths.make_path(self._file_path)
示例#5
0
 def __init__(self, instructions, models, controllers):
     super(PrivateDataMetaDataBuilder,
           self).__init__(2.0, instructions, models, controllers,
                          'private-data-meta-data-2.0')
     LOG.info('%s()' % KenLog.fcn())
     self.cloud_desc = self._models['CloudDescription']['cloud']
     self._file_path = ArdanaPaths.get_output_path(self._instructions,
                                                   self.cloud_desc)
     self._version = self._instructions['model_version']
     self._version = Version.normalize(self._version)
     self._meta_data = {}
 def __init__(self, instructions, models, controllers):
     super(PersistentStateBuilder,
           self).__init__(2.0, instructions, models, controllers,
                          'persistent-state-2.0')
     LOG.info('%s()' % KenLog.fcn())
     self._controllers = controllers
     self._models = models
     cloud_config = self._controllers['CloudConfig']
     self._persistence_path = cloud_config.get_persistent_path(self._models)
     if not os.path.isdir(self._persistence_path):
         os.makedirs(self._persistence_path)
     self.cloud_desc = self._models['CloudDescription']['cloud']
     self._file_path = ArdanaPaths.get_output_path(self._instructions,
                                                   self.cloud_desc)
     self._version = self._instructions['model_version']
     self._version = Version.normalize(self._version)
     self._password_change = {}