git://git.onelab.eu
/
sfa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5db8bc4
)
method name is get_key not request_key. use commands instead of os.system
author
Tony Mack
<tmack@cs.princeton.edu>
Mon, 7 Dec 2009 22:55:17 +0000
(22:55 +0000)
committer
Tony Mack
<tmack@cs.princeton.edu>
Mon, 7 Dec 2009 22:55:17 +0000
(22:55 +0000)
sfa/methods/get_key.py
patch
|
blob
|
history
diff --git
a/sfa/methods/get_key.py
b/sfa/methods/get_key.py
index
6e84d32
..
8f2c2f2
100644
(file)
--- a/
sfa/methods/get_key.py
+++ b/
sfa/methods/get_key.py
@@
-2,13
+2,14
@@
### $URL: $
import os
import tempfile
### $URL: $
import os
import tempfile
+import commands
from sfa.util.faults import *
from sfa.util.misc import *
from sfa.util.method import Method
from sfa.util.parameter import Parameter, Mixed
from sfa.trust.auth import Auth
from sfa.util.faults import *
from sfa.util.misc import *
from sfa.util.method import Method
from sfa.util.parameter import Parameter, Mixed
from sfa.trust.auth import Auth
-class
reques
t_key(Method):
+class
ge
t_key(Method):
"""
Generate a new keypair and gid for requesting caller (component).
@return 1 If successful
"""
Generate a new keypair and gid for requesting caller (component).
@return 1 If successful
@@
-57,7
+58,10
@@
class request_key(Method):
host = node['hostname']
dest="/etc/sfa/nodekey.key"
identity = "/etc/planetlab/root_ssh_key.pub"
host = node['hostname']
dest="/etc/sfa/nodekey.key"
identity = "/etc/planetlab/root_ssh_key.pub"
- os.system("scp -i %(identity)s %(filename)s root@%(host)s:%(dest)s" % locals()
- os.remove(filename)
+ scp_command = "scp -i %(identity)s %(filename)s root@%(host)s:%(dest)s" % locals()
+ (status, output) = commands(scp_command)
+ if status:
+ raise Exception, output
+ os.unlink(filename)
return 1
return 1