Created
December 28, 2012 03:18
-
-
Save lowks/4394197 to your computer and use it in GitHub Desktop.
Distcmds configure
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding=utf-8 | |
from cot.lib.distcmd import * | |
class configure(MyCommand): | |
user_options = [ | |
('log-dir=', 'l', 'Location of log directory.'), | |
('output-dir=', 'o', 'Output directory.'), | |
('virtual-env=', 'e', 'Virtual Env'), | |
('user=', 'u', 'User'), | |
('group=', 'g', 'Group'), | |
('vault-import-dir=', 'd', 'Vault import tmp directory'), | |
('vault-export-dir=', 'j', 'Vault export tmp directory'), | |
('vault-url=', 'r', 'Vault url'), | |
('here=', 'h', 'Vault Source directory'), | |
('site=', 'k', 'Site Name'), | |
('apache-allow=', 'a', 'IPs allowed to access to Vault Server (Apache)\ | |
Separated by space'), | |
] | |
defaults = { | |
'log_dir': path(root), | |
'output_dir': path(root), | |
'virtual_env': path(root), | |
'user': 'lca', | |
'group': 'lca', | |
'vault_import_dir': path('/tmp/vault_import'), | |
'vault_export_dir': path('/tmp/vault_export'), | |
'here': path(root), | |
'apache_allow': 'All', | |
} | |
def finalize_options(self): | |
""" | |
""" | |
pass | |
def run(self): | |
self.configure_config() | |
self.configure_apache() | |
self.configure_logging() | |
def configure_config(self): | |
params = {} | |
params['vault_import_dir'] = self.vault_import_dir | |
params['vault_export_dir'] = self.vault_export_dir | |
self.replace(path('config.ini.sample'), path('config.ini'), params) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment