Esempio n. 1
0
    def test_symlink_no_exist(self, remove_mock, symlink_mock, _):
        from_path = '/tmp/from/path'
        to_path = '/tmp/to/path'
        utils.symlink(from_path, to_path)

        symlink_mock.assert_called_once_with(from_path, to_path)
        self.called_once(remove_mock)
    def test_symlink_no_exist(self, remove_mock, symlink_mock, _):
        from_path = '/tmp/from/path'
        to_path = '/tmp/to/path'
        utils.symlink(from_path, to_path)

        symlink_mock.assert_called_once_with(from_path, to_path)
        self.called_once(remove_mock)
Esempio n. 3
0
    def switch_to_previous_configs(self):
        """Switch to previous version of fuel
        """
        current_cfg_path = self.config.supervisor['current_configs_prefix']

        utils.symlink(self.previous_supervisor_config_path, current_cfg_path)
        self.supervisor.reloadConfig()
Esempio n. 4
0
    def switch_to_previous_configs(self):
        """Switch to previous version of fuel
        """
        current_cfg_path = self.config.supervisor['current_configs_prefix']

        utils.symlink(
            self.previous_supervisor_config_path,
            current_cfg_path)
    def switch_to_new_configs(self):
        """Switch to new version of configs
        for supervisor. Creates symlink on special
        directory.
        """
        current_cfg_path = self.config.supervisor['current_configs_prefix']

        utils.symlink(self.supervisor_config_dir, current_cfg_path)
Esempio n. 6
0
    def switch_to_new_configs(self):
        """Switch to new version of configs
        for supervisor. Creates symlink on special
        directory.
        """
        current_cfg_path = self.config.supervisor['current_configs_prefix']

        utils.symlink(self.supervisor_config_dir, current_cfg_path)
Esempio n. 7
0
    def switch_version_file_to_previous_version(self):
        """Switch version.yaml symlink to previous version
        """
        logger.info(u'Switch current version file to previous version')
        previous_version_path = self.config.previous_version_path

        utils.symlink(previous_version_path,
                      self.config.current_fuel_version_path)
Esempio n. 8
0
    def switch_version_file_to_previous_version(self):
        """Switch version.yaml symlink to previous version
        """
        logger.info(u'Switch current version file to previous version')
        previous_version_path = self.config.previous_version_path

        utils.symlink(
            previous_version_path,
            self.config.current_fuel_version_path)
Esempio n. 9
0
    def switch_version_to_new(self):
        """Switches version.yaml file to new version

        * creates new version yaml file
        * and creates symlink to /etc/fuel/version.yaml
        """
        logger.info(u'Run post upgrade actions')
        version_yaml_from_upgrade = self.config.new_upgrade_version_path
        new_version_path = self.config.new_version_path

        utils.create_dir_if_not_exists(os.path.dirname(new_version_path))
        utils.copy(version_yaml_from_upgrade, new_version_path)
        utils.symlink(new_version_path, self.config.current_fuel_version_path)
Esempio n. 10
0
    def switch_version_to_new(self):
        """Switches version.yaml file to new version

        * creates new version yaml file
        * and creates symlink to /etc/fuel/version.yaml
        """
        logger.info(u'Run post upgrade actions')
        version_yaml_from_upgrade = self.config.new_upgrade_version_path
        new_version_path = self.config.new_version_path

        utils.create_dir_if_not_exists(os.path.dirname(new_version_path))
        utils.copy(version_yaml_from_upgrade, new_version_path)
        utils.symlink(new_version_path, self.config.current_fuel_version_path)
Esempio n. 11
0
    def switch_to_new(self):
        """Switche version file to new version

        * creates new version yaml file
        * and creates symlink to /etc/fuel/version.yaml
        """
        logger.info('Switch version file to new version')

        utils.create_dir_if_not_exists(os.path.dirname(
            self.dst_new_version_file))

        utils.copy(
            self.src_new_version_file,
            self.dst_new_version_file)

        utils.symlink(
            self.dst_new_version_file,
            self.current_version_file)
Esempio n. 12
0
 def switch_to_previous(self):
     """Switch version file symlink to previous version
     """
     logger.info('Switch current version file to previous version')
     utils.symlink(self.previous_version_file, self.current_version_file)
 def run(self):
     """Add link for repo/ubuntu/x86_64 -> repo/ubuntu/fuelweb/x86_64"""
     utils.symlink(self.ubuntu_x86_64_old, self.ubuntu_x86_64_new)
Esempio n. 14
0
 def run(self):
     """Add link for repo/ubuntu/x86_64 -> repo/ubuntu/fuelweb/x86_64
     """
     utils.symlink(self.ubuntu_x86_64_old, self.ubuntu_x86_64_new)
Esempio n. 15
0
 def do(self):
     symlink(self._from, self._to, self._overwrite)