Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Janitor spec #37

Merged
merged 3 commits into from
Oct 1, 2015
Merged

Janitor spec #37

merged 3 commits into from
Oct 1, 2015

Conversation

mkiwala
Copy link
Contributor

@mkiwala mkiwala commented Oct 1, 2015

Closes #38

perform_cleanup() now only accepts one argument, which is a janitor_spec
data structure which declare the environment variables that are required to
be set for cleanup and also provides a callable function for performing
the cleanup.

Example:

perform_cleanup(janitor_spec={
    'postgres': {
        'required_envvars': ['PTERO_LSF_DB_STRING'],
        'cleanup_action': lambda: PostgresJanitor(
            os.environ['PTERO_LSF_DB_STRING']).clean(),
        },
    })

The purpose of changing the perform_cleanup() API is to allow for better
argument parsing in the Janitor. Now the purge-backends scripts accept as
arguments the backends which should be cleaned or --all to run the janitor for
all of the backends.

Example usages:

$ PTERO_LSF_DB_STRING=postgres:/dbhost/  purge-backends --postgres

-or-

$ PTERO_LSF_DB_STRING=postgres:/dbhost/  purge-backends --all

perform_cleanup() now only accepts one argument, which is a janitor_spec
data structure which declare the environment variables that are required to
be set for cleanup and also provides a callable function for performing
the cleanup.

Example:

perform_cleanup(janitor_spec={
    'postgres': {
        'required_envvars': ['PTERO_LSF_DB_STRING'],
        'cleanup_action': lambda: PostgresJanitor(
            os.environ['PTERO_LSF_DB_STRING']).clean(),
        },
    })

The purpose of changing the perform_cleanup() API is to allow for better
argument parsing in the Janitor.  Now the purge-backends scripts accept as
arguments the backends which should be cleaned or --all to run the janitor for
all of the backends.

Example usages:
$ PTERO_LSF_DB_STRING=postgres:/dbhost/  purge-backends --postgres

-or-

$ PTERO_LSF_DB_STRING=postgres:/dbhost/  purge-backends --all
@davidlmorton
Copy link
Contributor

+1

davidlmorton added a commit that referenced this pull request Oct 1, 2015
@davidlmorton davidlmorton merged commit 6bb64d9 into master Oct 1, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants