Commit f8c8467d authored by Dimitris Aragiorgis's avatar Dimitris Aragiorgis
Browse files

More pep8 fixes related to snf-deploy



Those fixes concern errors that are introduced in latest
pep8 version (and not the wheezy's one).
Signed-off-by: default avatarDimitris Aragiorgis <dimara@grnet.gr>
parent d7dfc73e
......@@ -581,8 +581,8 @@ def main():
do_create_ddns_keys(args, env)
return 0
else:
if ((args.key_inject and not args.ssh_key and must_create_keys(env)) or
must_create_ddns_keys(env)):
if ((args.key_inject and not args.ssh_key and
must_create_keys(env)) or must_create_ddns_keys(env)):
print "No ssh/ddns keys to use. Run `snf-deploy keygen' first."
return 1
env.ddns_keys = find_ddns_key_files(env)
......
......@@ -100,7 +100,7 @@ class SSH(SynnefoComponent):
files = [
"authorized_keys", "id_dsa", "id_dsa.pub", "id_rsa", "id_rsa.pub"
]
ssh = [("/root/.ssh/%s" % f, {}, {"mode":0600}) for f in files]
ssh = [("/root/.ssh/%s" % f, {}, {"mode": 0600}) for f in files]
return ssh
def initialize(self):
......@@ -289,7 +289,7 @@ su - postgres -c "psql -w -d snf_apps -f /tmp/psqlcmd"
def allow_access_in_db(self, node_info, user="all", method="md5"):
f = "/etc/postgresql/*/main/pg_hba.conf"
cmd1 = "echo host all %s %s/32 %s >> %s" % \
(user, node_info.ip, method, f)
(user, node_info.ip, method, f)
cmd2 = "sed -i 's/\(host.*127.0.0.1.*\)md5/\\1trust/' %s" % f
return [cmd1, cmd2] + self.restart()
......@@ -378,19 +378,19 @@ class Ganeti(SynnefoComponent):
class Master(SynnefoComponent):
def add_rapi_user(self):
x = "%s:Ganeti Remote API:%s" % \
(self.env.env.synnefo_user, self.env.env.synnefo_rapi_passwd)
(self.env.env.synnefo_user, self.env.env.synnefo_rapi_passwd)
commands = [
"echo %s {HA1}$(echo -n %s | openssl md5 | sed 's/^.* //') write > \
/var/lib/ganeti/rapi/users" % (self.env.env.synnefo_user, x),
]
"echo %s {HA1}$(echo -n %s | openssl md5 | sed 's/^.* //') write" +
" > /var/lib/ganeti/rapi/users" % (self.env.env.synnefo_user, x),
]
return commands + self.restart()
def add_node(self, node_info):
commands = [
"gnt-node add --no-ssh-key-check --master-capable=yes " +
"--vm-capable=yes " + node_info.fqdn,
"--vm-capable=yes " + node_info.fqdn,
]
return commands
......@@ -538,8 +538,8 @@ class Apache(SynnefoComponent):
def restart(self):
return [
"/etc/init.d/apache2 restart",
]
"/etc/init.d/apache2 restart",
]
class Gunicorn(SynnefoComponent):
......@@ -560,8 +560,8 @@ class Gunicorn(SynnefoComponent):
def restart(self):
return [
"/etc/init.d/gunicorn restart",
]
"/etc/init.d/gunicorn restart",
]
class Common(SynnefoComponent):
......@@ -590,8 +590,8 @@ class Common(SynnefoComponent):
def restart(self):
return [
"/etc/init.d/gunicorn restart",
]
"/etc/init.d/gunicorn restart",
]
class WEB(SynnefoComponent):
......@@ -618,8 +618,8 @@ class WEB(SynnefoComponent):
def restart(self):
return [
"/etc/init.d/gunicorn restart",
]
"/etc/init.d/gunicorn restart",
]
class Astakos(SynnefoComponent):
......@@ -916,7 +916,7 @@ snf-manage network-create --subnet6={0} \
passwd = self.env.env.synnefo_rapi_passwd
return [
"snf-manage backend-add --clustername=%s --user=%s --pass=%s" %
(cluster.fqdn, user, passwd)
(cluster.fqdn, user, passwd)
]
def undrain_backend(self):
......@@ -988,10 +988,10 @@ class Kamaki(SynnefoComponent):
def initialize(self):
url = "https://%s/astakos/identity/v2.0" % self.env.env.accounts.fqdn
token = self.env.user_auth_token
return [
"kamaki config set cloud.default.url %s" % url,
"kamaki config set cloud.default.token %s" %
self.env.user_auth_token,
"kamaki config set cloud.default.token %s" % token,
"kamaki container create images",
]
......
......@@ -116,7 +116,7 @@ def update_env_with_user_info():
match = r.search(result)
if env.dry_run:
env.user_id, env.user_auth_token, env.user_uuid = \
("dummy_uid", "dummy_user_auth_token", "dummy_user_uuid")
("dummy_uid", "dummy_user_auth_token", "dummy_user_uuid")
else:
env.user_id, env.user_auth_token, env.user_uuid = match.groups()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment