def _update_example_sg(self):

        example_blueprint_path = os.path.join(
            "{0}-{1}".format(HELLO_WORLD_EXAMPLE_NAME, self.branch), self.get_app_blueprint_file()
        )
        example_blueprint = StringIO()
        fab.get(example_blueprint_path, example_blueprint)
        hello_world_blueprint_yaml = yaml.load(example_blueprint.getvalue())

        hello_world_blueprint_yaml["node_templates"]["security_group"]["properties"]["security_group"] = {
            "description": ""
        }

        example_blueprint.seek(0)
        json.dump(hello_world_blueprint_yaml, example_blueprint)
        example_blueprint.truncate()

        fab.put(example_blueprint, example_blueprint_path)
    def _update_inputs_file(self, additional_inputs):
        """
        Update the remote bootstrap inputs file.

        :param additional_inputs the additional inputs to append
        :return:None
        """
        # Retrieve inputs from cli vm
        inputs_file = StringIO()
        fab.get(self.remote_bootstrap_inputs_path, inputs_file)
        inputs = yaml.load(inputs_file.getvalue())

        # Update the inputs to include the additional inputs
        inputs.update(additional_inputs)
        inputs_file.seek(0)
        json.dump(inputs, inputs_file)
        inputs_file.truncate()

        # Write the inputs back to the cli vm.
        fab.put(inputs_file, self.remote_bootstrap_inputs_path)
Пример #3
0
    def _update_inputs_file(self, additional_inputs):
        """
        Update the remote bootstrap inputs file.

        :param additional_inputs the additional inputs to append
        :return:None
        """
        # Retrieve inputs from cli vm
        inputs_file = StringIO()
        fab.get(self.remote_bootstrap_inputs_path, inputs_file)
        inputs = yaml.load(inputs_file.getvalue())

        # Update the inputs to include the additional inputs
        inputs.update(additional_inputs)
        inputs_file.seek(0)
        json.dump(inputs, inputs_file)
        inputs_file.truncate()

        # Write the inputs back to the cli vm.
        fab.put(inputs_file, self.remote_bootstrap_inputs_path)
Пример #4
0
    def _update_example_sg(self):

        example_blueprint_path = \
            os.path.join("{0}-{1}".format(HELLO_WORLD_EXAMPLE_NAME,
                                          self.branch),
                         self.app_blueprint_file)
        example_blueprint = StringIO()
        fab.get(example_blueprint_path, example_blueprint)
        hello_world_blueprint_yaml = yaml.load(example_blueprint.getvalue())

        hello_world_blueprint_yaml['node_templates']['security_group'][
            'properties']['security_group'] = {
                'description': ''
            }

        example_blueprint.seek(0)
        json.dump(hello_world_blueprint_yaml, example_blueprint)
        example_blueprint.truncate()

        fab.put(example_blueprint, example_blueprint_path)