def __init__(self, conf_file): self.base_dir = os.path.dirname(conf_file) "Info for common section" self.conf = readconf(conf_file, 'common') self.user = self.conf.get('ssh_user', 'swiftops') self.key = self.conf.get('ssh_key', '/home/swiftops/.ssh/id_rsa') self.apt_opts = self.conf.get('apt_options', '-y -qq --force-yes') self.swift_generic = self.conf.get('swift_generic') self.swift_proxy = self.conf.get('swift_proxy') self.swift_storage = self.conf.get('swift_storage') self.swift_others = self.conf.get('swift_others', '') "Info for versioning section" self.conf = readconf(conf_file, 'versioning') self.ver_system = self.conf.get('versioning_system', 'git') self.repo_base = self.conf.get('repository_base', '/srv/git') self.repo_name = self.conf.get('repository_name', 'swift-cluster-configs') "Info for swift section" self.conf = readconf(conf_file, 'swift_common') self.admin_ip = self.conf.get('admin_ip', '172.16.0.254') "Some Fabric environmental variables" env.user = self.user env.key_filename = self.key env.warn_only = True env.parallel = True env.pool_size = 5 "Keyring packages that might be needed" self.keyrings = ['ubuntu-cloud-keyring'] "Utilities that will be install on all systems by the common setup" self.general_tools = ['python-software-properties', 'patch', 'debconf', 'bonnie++', 'dstat', 'ethtool', 'python-configobj', 'curl', 'subversion', 'git-core', 'iptraf', 'htop', 'syslog-ng', 'nmon', 'strace', 'iotop', 'debsums', 'python-pip', 'snmpd', 'snmp', 'bsd-mailx', 'xfsprogs', 'ntp', 'snmp-mibs-downloader', 'exim4', 'screen'] if not os.path.isfile(self.key): status = 404 msg = 'SSH private key could not be located [%s]' % self.key raise ResponseError(status, msg)
def __init__(self, conf_file): self.base_dir = os.path.dirname(conf_file) "Info for common section" self.conf = readconf(conf_file, 'common') self.user = self.conf.get('ssh_user', 'swiftops') self.key = self.conf.get('ssh_key', '/home/swiftops/.ssh/id_rsa') self.apt_opts = self.conf.get('apt_options', '-y -qq --force-yes') self.swift_generic = self.conf.get('swift_generic') self.swift_proxy = self.conf.get('swift_proxy') self.swift_storage = self.conf.get('swift_storage') self.swift_others = self.conf.get('swift_others', '') "Info for versioning section" self.conf = readconf(conf_file, 'versioning') self.ver_system = self.conf.get('versioning_system', 'git') self.repo_base = self.conf.get('repository_base', '/srv/git') self.repo_name = self.conf.get('repository_name', 'swift-cluster-configs') "Info for swift section" self.conf = readconf(conf_file, 'swift_common') self.admin_ip = self.conf.get('admin_ip', '172.16.0.254') "Some Fabric environmental variables" env.user = self.user env.key_filename = self.key env.warn_only = True env.parallel = True env.pool_size = 5 "Keyring packages that might be needed" self.keyrings = ['ubuntu-cloud-keyring'] "Utilities that will be install on all systems by the common setup" self.general_tools = [ 'python-software-properties', 'patch', 'debconf', 'bonnie++', 'dstat', 'ethtool', 'python-configobj', 'curl', 'subversion', 'git-core', 'iptraf', 'htop', 'syslog-ng', 'nmon', 'strace', 'iotop', 'debsums', 'python-pip', 'snmpd', 'snmp', 'bsd-mailx', 'xfsprogs', 'ntp', 'snmp-mibs-downloader', 'exim4', 'screen' ] if not os.path.isfile(self.key): status = 404 msg = 'SSH private key could not be located [%s]' % self.key raise ResponseError(status, msg)
def __init__(self, conf_file, base_dir): self.conf = readconf(conf_file) self.base_dir = base_dir self.tmpl_dir = base_dir + '/templates' if not os.path.isdir(self.tmpl_dir): status = 404 msg = 'Template directory not found [%s]' % self.tmpl_dir raise ResponseError(status, msg)