コード例 #1
0
ファイル: swift.py プロジェクト: hagleitn/Openstack-Devstack2
 def _get_param_map(self, config_fn):
     return {
         'USER':
         self.cfg.getdefaulted('swift', 'swift_user', sh.getuser()),
         'GROUP':
         self.cfg.getdefaulted('swift', 'swift_group', sh.getgroupname()),
         'SWIFT_DATA_LOCATION':
         self.datadir,
         'SWIFT_CONFIG_LOCATION':
         self.cfg_dir,
         'SERVICE_TOKEN':
         self.cfg.get('passwords', 'service_token'),
         'AUTH_SERVER':
         self.auth_server,
         'SWIFT_HASH':
         self.cfg.get('passwords', 'swift_hash'),
         'SWIFT_LOGDIR':
         self.logdir,
         'SWIFT_PARTITION_POWER_SIZE':
         self.cfg.getdefaulted('swift', 'partition_power_size', '9'),
         # Note: leave these alone, will be adjusted later
         'NODE_PATH':
         '%NODE_PATH%',
         'BIND_PORT':
         '%BIND_PORT%',
         'LOG_FACILITY':
         '%LOG_FACILITY%',
     }
コード例 #2
0
 def _get_apache_user_group(self):
     user = self.cfg.get('horizon', 'apache_user')
     if not user:
         user = sh.getuser()
     group = self.cfg.get('horizon', 'apache_group')
     if not group:
         group = sh.getgroupname()
     return (user, group)
コード例 #3
0
 def _get_apache_user_group(self):
     user = self.cfg.get("horizon", "apache_user")
     if not user:
         user = sh.getuser()
     group = self.cfg.get("horizon", "apache_group")
     if not group:
         group = sh.getgroupname()
     return (user, group)
コード例 #4
0
def add_header(fn, contents):
    lines = list()
    lines.append('# Adjusted source file %s' % (fn.strip()))
    lines.append("# On %s" % (date.rcf8222date()))
    lines.append("# By user %s, group %s" % (sh.getuser(), sh.getgroupname()))
    lines.append("# Comments may have been removed (TODO: darn python config writer)")
    lines.append("")
    if contents:
        lines.append(contents)
    return utils.joinlinesep(*lines)
コード例 #5
0
def add_header(fn, contents):
    lines = list()
    if not fn:
        fn = "???"
    lines.append('# Adjusted source file %s' % (fn.strip()))
    lines.append("# On %s" % (date.rcf8222date()))
    lines.append("# By user %s, group %s" % (sh.getuser(), sh.getgroupname()))
    lines.append("")
    if contents:
        lines.append(contents)
    return utils.joinlinesep(*lines)
コード例 #6
0
def add_header(fn, contents):
    lines = list()
    lines.append('# Adjusted source file %s' % (fn.strip()))
    lines.append("# On %s" % (date.rcf8222date()))
    lines.append("# By user %s, group %s" % (sh.getuser(), sh.getgroupname()))
    lines.append("# Comments may have been removed (TODO: darn python config writer)")
    # TODO Maybe use https://code.google.com/p/iniparse/ which seems to preserve comments!
    lines.append("")
    if contents:
        lines.append(contents)
    return utils.joinlinesep(*lines)
コード例 #7
0
ファイル: cfg.py プロジェクト: hagleitn/Openstack-Devstack2
def add_header(fn, contents):
    lines = list()
    lines.append('# Adjusted source file %s' % (fn.strip()))
    lines.append("# On %s" % (date.rcf8222date()))
    lines.append("# By user %s, group %s" % (sh.getuser(), sh.getgroupname()))
    lines.append("# Comments may have been removed (TODO: darn python config writer)")
    # TODO Maybe use https://code.google.com/p/iniparse/ which seems to preserve comments!
    lines.append("")
    if contents:
        lines.append(contents)
    return utils.joinlinesep(*lines)
コード例 #8
0
ファイル: cfg.py プロジェクト: dreamhost/Openstack-DevstackPy
def add_header(fn, contents):
    lines = list()
    if not fn:
        fn = "???"
    lines.append("# Adjusted source file %s" % (fn.strip()))
    lines.append("# On %s" % (date.rcf8222date()))
    lines.append("# By user %s, group %s" % (sh.getuser(), sh.getgroupname()))
    lines.append("")
    if contents:
        lines.append(contents)
    return utils.joinlinesep(*lines)
コード例 #9
0
ファイル: swift.py プロジェクト: hagleitn/Openstack-Devstack2
 def _get_param_map(self, config_fn):
     return {
         'USER': self.cfg.getdefaulted('swift', 'swift_user', sh.getuser()),
         'GROUP': self.cfg.getdefaulted('swift', 'swift_group', sh.getgroupname()),
         'SWIFT_DATA_LOCATION': self.datadir,
         'SWIFT_CONFIG_LOCATION': self.cfg_dir,
         'SERVICE_TOKEN': self.cfg.get('passwords', 'service_token'),
         'AUTH_SERVER': self.auth_server,
         'SWIFT_HASH': self.cfg.get('passwords', 'swift_hash'),
         'SWIFT_LOGDIR': self.logdir,
         'SWIFT_PARTITION_POWER_SIZE': self.cfg.getdefaulted('swift', 'partition_power_size', '9'),
         # Note: leave these alone, will be adjusted later
         'NODE_PATH': '%NODE_PATH%',
         'BIND_PORT': '%BIND_PORT%',
         'LOG_FACILITY': '%LOG_FACILITY%',
     }
コード例 #10
0
 def _get_apache_user_group(self):
     user = self.cfg.getdefaulted('horizon', 'apache_user', sh.getuser())
     group = self.cfg.getdefaulted('horizon', 'apache_group',
                                   sh.getgroupname())
     return (user, group)
コード例 #11
0
 def _get_apache_user_group(self):
     user = self.cfg.getdefaulted('horizon', 'apache_user', sh.getuser())
     group = self.cfg.getdefaulted('horizon', 'apache_group', sh.getgroupname())
     return (user, group)