Tidy lint
This commit is contained in:
@@ -70,7 +70,7 @@ def generate_cert():
|
|||||||
'-out', CERT, '-keyout', KEY,
|
'-out', CERT, '-keyout', KEY,
|
||||||
'-subj', subj]
|
'-subj', subj]
|
||||||
subprocess.check_call(cmd)
|
subprocess.check_call(cmd)
|
||||||
os.chmod(KEY, 0600)
|
os.chmod(KEY, 0o600)
|
||||||
# Slurp as base64 encoded - makes handling easier up the stack
|
# Slurp as base64 encoded - makes handling easier up the stack
|
||||||
with open(CERT, 'r') as cfile:
|
with open(CERT, 'r') as cfile:
|
||||||
ssl_cert = b64encode(cfile.read())
|
ssl_cert = b64encode(cfile.read())
|
||||||
@@ -110,6 +110,7 @@ class ApacheSSLContext(SSLContext):
|
|||||||
|
|
||||||
|
|
||||||
class SwiftRingContext(OSContextGenerator):
|
class SwiftRingContext(OSContextGenerator):
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
allowed_hosts = []
|
allowed_hosts = []
|
||||||
for relid in relation_ids('swift-storage'):
|
for relid in relation_ids('swift-storage'):
|
||||||
@@ -148,7 +149,7 @@ class SwiftIdentityContext(OSContextGenerator):
|
|||||||
admin_user = config('keystone-admin-user')
|
admin_user = config('keystone-admin-user')
|
||||||
admin_password = config('keystone-admin-user')
|
admin_password = config('keystone-admin-user')
|
||||||
if (auth_type == 'keystone' and auth_host
|
if (auth_type == 'keystone' and auth_host
|
||||||
and admin_user and admin_password):
|
and admin_user and admin_password):
|
||||||
log('Using user-specified Keystone configuration.')
|
log('Using user-specified Keystone configuration.')
|
||||||
ks_auth = {
|
ks_auth = {
|
||||||
'auth_type': 'keystone',
|
'auth_type': 'keystone',
|
||||||
@@ -169,7 +170,7 @@ class SwiftIdentityContext(OSContextGenerator):
|
|||||||
'auth_protocol': relation_get('auth_protocol',
|
'auth_protocol': relation_get('auth_protocol',
|
||||||
unit, relid) or 'http',
|
unit, relid) or 'http',
|
||||||
'service_protocol': relation_get('service_protocol',
|
'service_protocol': relation_get('service_protocol',
|
||||||
unit, relid) or 'http',
|
unit, relid) or 'http',
|
||||||
'keystone_host': relation_get('auth_host',
|
'keystone_host': relation_get('auth_host',
|
||||||
unit, relid),
|
unit, relid),
|
||||||
'auth_port': relation_get('auth_port',
|
'auth_port': relation_get('auth_port',
|
||||||
@@ -191,6 +192,7 @@ class SwiftIdentityContext(OSContextGenerator):
|
|||||||
|
|
||||||
|
|
||||||
class MemcachedContext(OSContextGenerator):
|
class MemcachedContext(OSContextGenerator):
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
ctxt = {
|
ctxt = {
|
||||||
'proxy_ip': get_host_ip(unit_get('private-address'))
|
'proxy_ip': get_host_ip(unit_get('private-address'))
|
||||||
@@ -219,6 +221,7 @@ def get_swift_hash():
|
|||||||
|
|
||||||
|
|
||||||
class SwiftHashContext(OSContextGenerator):
|
class SwiftHashContext(OSContextGenerator):
|
||||||
|
|
||||||
def __call__(self):
|
def __call__(self):
|
||||||
ctxt = {
|
ctxt = {
|
||||||
'swift_hash': get_swift_hash()
|
'swift_hash': get_swift_hash()
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ def install():
|
|||||||
# configure a directory on webserver for distributing rings.
|
# configure a directory on webserver for distributing rings.
|
||||||
www_dir = get_www_dir()
|
www_dir = get_www_dir()
|
||||||
if not os.path.isdir(www_dir):
|
if not os.path.isdir(www_dir):
|
||||||
os.mkdir(www_dir, 0755)
|
os.mkdir(www_dir, 0o755)
|
||||||
uid, gid = swift_user()
|
uid, gid = swift_user()
|
||||||
os.chown(www_dir, uid, gid)
|
os.chown(www_dir, uid, gid)
|
||||||
|
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ def swift_user(username='swift'):
|
|||||||
|
|
||||||
def ensure_swift_dir(conf_dir=os.path.dirname(SWIFT_CONF)):
|
def ensure_swift_dir(conf_dir=os.path.dirname(SWIFT_CONF)):
|
||||||
if not os.path.isdir(conf_dir):
|
if not os.path.isdir(conf_dir):
|
||||||
os.mkdir(conf_dir, 0750)
|
os.mkdir(conf_dir, 0o750)
|
||||||
uid, gid = swift_user()
|
uid, gid = swift_user()
|
||||||
os.chown(conf_dir, uid, gid)
|
os.chown(conf_dir, uid, gid)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user