Commit 13b3488a by Bach Dániel

celery: code formatting

parent 31b28ef0
...@@ -5,7 +5,7 @@ from celery import Celery, task ...@@ -5,7 +5,7 @@ from celery import Celery, task
import time, re import time, re
import socket import socket
import sys import sys
import tempfile, os, stat, re, base64, struct, logging import tempfile, os, stat, re, base64, struct, logging
from celery.contrib import rdb from celery.contrib import rdb
...@@ -85,7 +85,7 @@ def t(name, instance_type, disk_id, network_id, ctx): ...@@ -85,7 +85,7 @@ def t(name, instance_type, disk_id, network_id, ctx):
from xml.dom.minidom import parse, parseString from xml.dom.minidom import parse, parseString
try: try:
x = parseString(out) x = parseString(out)
return { return {
'one_id': int(x.getElementsByTagName("ID")[0].childNodes[0].nodeValue), 'one_id': int(x.getElementsByTagName("ID")[0].childNodes[0].nodeValue),
'interfaces': [ 'interfaces': [
{ {
...@@ -107,7 +107,7 @@ def t(one_id, new_img): ...@@ -107,7 +107,7 @@ def t(one_id, new_img):
@task(name="one.tasks.UpdateDiskTask") @task(name="one.tasks.UpdateDiskTask")
def t(): def t():
f = tempfile.NamedTemporaryFile(delete=False) f = tempfile.NamedTemporaryFile(delete=False)
f.close() f.close()
out='' out=''
proc = subprocess.Popen(["/opt/occi.sh storage list > %s" % f.name], proc = subprocess.Popen(["/opt/occi.sh storage list > %s" % f.name],
...@@ -132,7 +132,7 @@ def t(): ...@@ -132,7 +132,7 @@ def t():
@task(name="one.tasks.UpdateNetworkTask") @task(name="one.tasks.UpdateNetworkTask")
def t(): def t():
f = tempfile.NamedTemporaryFile(delete=False) f = tempfile.NamedTemporaryFile(delete=False)
f.close() f.close()
out='' out=''
proc = subprocess.Popen(["/opt/occi.sh network list > %s" % f.name], proc = subprocess.Popen(["/opt/occi.sh network list > %s" % f.name],
......
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 sign in to comment