def validate_attempt(self, pid): """ Checks if we can kill the process """ command = self.examine_process(pid) critical_process_prefix = ['postgres', gp.get_gphome(), dereference_symlink(gp.get_gphome())] for prefix in critical_process_prefix: if command.startswith(prefix): raise KillError('process %s may not be killed' % pid) if not command.startswith('python ' + gp.get_gphome()): raise KillError('process %s ignored by gpkill as it is not a greenplum process' % pid)
os_string = '' if dist.lower() == 'redhat': os_string += 'rhel' elif dist.lower() == 'suse': os_string += 'suse' os_string += major_release return os_string OS = get_os() ARCH = platform.machine() # AK: use dereference_symlink when mucking with RPM database for the same reason # it's used in the gppylib.operations.package. For more info, see the function definition. GPHOME = dereference_symlink(gp.get_gphome()) ARCHIVE_PATH = os.path.join(GPHOME, 'share/packages/archive') RPM_DATABASE = os.path.join(GPHOME, 'share/packages/database') GPPKG_EXTENSION = ".gppkg" SCRATCH_SPACE = os.path.join(tempfile.gettempdir(), getpass.getuser()) GPDB_VERSION = '.'.join([str(n) for n in MAIN_VERSION[:2]]) MASTER_PORT = os.getenv("PGPORT") def skipIfNoStandby(): """ A decorator which skips a unit test if a standby is not already present in the cluster. """ standby = get_host_list()[0] if standby is None: