mirror of
https://github.com/retspen/webvirtcloud
synced 2024-10-31 19:44:16 +00:00
Fixed PEP8
This commit is contained in:
parent
2a5618ca2e
commit
5714f0945a
1 changed files with 2 additions and 2 deletions
|
@ -23,7 +23,7 @@ class MyTCPServerHandler(SocketServer.BaseRequestHandler):
|
|||
data = json.loads(self.request.recv(1024).strip())
|
||||
|
||||
# GuestFS
|
||||
gfs = guestfs.GuestFS (python_return_dict=True)
|
||||
gfs = guestfs.GuestFS(python_return_dict=True)
|
||||
try:
|
||||
gfs.add_domain(data['vname'])
|
||||
gfs.launch()
|
||||
|
@ -41,7 +41,7 @@ class MyTCPServerHandler(SocketServer.BaseRequestHandler):
|
|||
self.request.sendall(json.dumps({'return': 'success'}))
|
||||
if data['action'] == 'publickey':
|
||||
if not gfs.is_dir('/root/.ssh'):
|
||||
gfs.mkdir ('/root/.ssh')
|
||||
gfs.mkdir('/root/.ssh')
|
||||
gfs.chmod(0700, "/root/.ssh")
|
||||
gfs.write('/root/.ssh/authorized_keys', data['key'])
|
||||
gfs.chmod(0600, '/root/.ssh/authorized_keys')
|
||||
|
|
Loading…
Reference in a new issue