def undo(self, workflow_dict):
        LOG.info("Running undo...")
        try:
            volume = workflow_dict['volume']
            host = workflow_dict['host']
            old_volume = workflow_dict['old_volume']

            source_export_path = scape_nfsaas_export_path(volume.nfsaas_path)
            target_export_path = scape_nfsaas_export_path(
                old_volume.nfsaas_path)
            return_code, output = update_fstab(
                host=host,
                source_export_path=source_export_path,
                target_export_path=target_export_path)
            if return_code != 0:
                LOG.info(str(output))

            return True
        except Exception:
            traceback = full_stack()

            workflow_dict['exceptions']['error_codes'].append(DBAAS_0022)
            workflow_dict['exceptions']['traceback'].append(traceback)

            return False
    def do(self, workflow_dict):
        try:
            for host_and_export in workflow_dict['hosts_and_exports']:
                host = host_and_export['host']
                source_export_path = scape_nfsaas_export_path(host_and_export['old_export_path'])
                target_export_path = scape_nfsaas_export_path(host_and_export['new_export_path'])
                return_code, output = update_fstab(host=host,
                                                   source_export_path=source_export_path,
                                                   target_export_path=target_export_path)
                if return_code != 0:
                    raise Exception(str(output))

            return True
        except Exception:
            traceback = full_stack()

            workflow_dict['exceptions']['error_codes'].append(DBAAS_0021)
            workflow_dict['exceptions']['traceback'].append(traceback)

            return False
    def do(self, workflow_dict):
        try:
            volume = workflow_dict['volume']
            host = workflow_dict['host']
            old_volume = workflow_dict['old_volume']

            source_export_path = scape_nfsaas_export_path(old_volume.nfsaas_path)
            target_export_path = scape_nfsaas_export_path(volume.nfsaas_path)
            return_code, output = update_fstab(host=host,
                                               source_export_path=source_export_path,
                                               target_export_path=target_export_path)
            if return_code != 0:
                raise Exception(str(output))

            return True
        except Exception:
            traceback = full_stack()

            workflow_dict['exceptions']['error_codes'].append(DBAAS_0022)
            workflow_dict['exceptions']['traceback'].append(traceback)

            return False
Esempio n. 4
0
    def do(self, workflow_dict):
        try:
            for host_and_export in workflow_dict['hosts_and_exports']:
                host = host_and_export['host']
                source_export_path = scape_nfsaas_export_path(
                    host_and_export['old_export_path'])
                target_export_path = scape_nfsaas_export_path(
                    host_and_export['new_export_path'])
                return_code, output = update_fstab(
                    host=host,
                    source_export_path=source_export_path,
                    target_export_path=target_export_path)
                if return_code != 0:
                    raise Exception(str(output))

            return True
        except Exception:
            traceback = full_stack()

            workflow_dict['exceptions']['error_codes'].append(DBAAS_0021)
            workflow_dict['exceptions']['traceback'].append(traceback)

            return False