Skip to content

Instantly share code, notes, and snippets.

@lowks
Created December 28, 2012 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lowks/4394197 to your computer and use it in GitHub Desktop.
Save lowks/4394197 to your computer and use it in GitHub Desktop.
Distcmds configure
# 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