예제 #1
0
 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
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
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
 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)