diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-06-06 09:31:14 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-06-06 09:31:48 -0400 |
commit | 1291e5b09efb956d42e7ab83d485d41542f438f4 (patch) | |
tree | cde83f5ecbe7b72ab20e013dea06098742ebed26 /src/lib/Bcfg2/Options.py | |
parent | f46d4216cd4d6a4b272bfff1465a19a5649a93e7 (diff) | |
download | bcfg2-1291e5b09efb956d42e7ab83d485d41542f438f4.tar.gz bcfg2-1291e5b09efb956d42e7ab83d485d41542f438f4.tar.bz2 bcfg2-1291e5b09efb956d42e7ab83d485d41542f438f4.zip |
added properties element encryption
added bcfg2-crypt utility for encrypting Properties and Cfg files
Diffstat (limited to 'src/lib/Bcfg2/Options.py')
-rw-r--r-- | src/lib/Bcfg2/Options.py | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/lib/Bcfg2/Options.py b/src/lib/Bcfg2/Options.py index 0791ce343..6d3dd0a8c 100644 --- a/src/lib/Bcfg2/Options.py +++ b/src/lib/Bcfg2/Options.py @@ -730,6 +730,43 @@ CFG_VALIDATION = \ long_arg=True, cook=get_bool) +# bcfg2-crypt options +ENCRYPT = \ + Option('Encrypt the specified file', + default=False, + cmd='--encrypt', + long_arg=True) +DECRYPT = \ + Option('Decrypt the specified file', + default=False, + cmd='--decrypt', + long_arg=True) +CRYPT_PASSPHRASE = \ + Option('Encryption passphrase (name or passphrase)', + default=None, + cmd='-p', + odesc='<passphrase>') +CRYPT_XPATH = \ + Option('XPath expression to select elements to encrypt', + default=None, + cmd='--xpath', + odesc='<xpath>', + long_arg=True) +CRYPT_PROPERTIES = \ + Option('Encrypt the specified file as a Properties file', + default=False, + cmd="--properties", + long_arg=True) +CRYPT_CFG = \ + Option('Encrypt the specified file as a Cfg file', + default=False, + cmd="--cfg", + long_arg=True) +CRYPT_REMOVE = \ + Option('Remove the plaintext file after encrypting', + default=False, + cmd="--remove", + long_arg=True) # Option groups CLI_COMMON_OPTIONS = dict(configfile=CFILE, @@ -754,6 +791,14 @@ SERVER_COMMON_OPTIONS = dict(repo=SERVER_REPOSITORY, ca=SERVER_CA, protocol=SERVER_PROTOCOL) +CRYPT_OPTIONS = dict(encrypt=ENCRYPT, + decrypt=DECRYPT, + passphrase=CRYPT_PASSPHRASE, + xpath=CRYPT_XPATH, + properties=CRYPT_PROPERTIES, + cfg=CRYPT_CFG, + remove=CRYPT_REMOVE) + DRIVER_OPTIONS = \ dict(apt_install_path=CLIENT_APT_TOOLS_INSTALL_PATH, apt_var_path=CLIENT_APT_TOOLS_VAR_PATH, |