]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Move username to a utility method.
authorJosh Durgin <josh.durgin@dreamhost.com>
Sat, 2 Jul 2011 01:15:52 +0000 (18:15 -0700)
committerJosh Durgin <josh.durgin@dreamhost.com>
Thu, 7 Jul 2011 19:32:58 +0000 (12:32 -0700)
teuthology/misc.py
teuthology/run.py

index 974819dca42eeac825978056edc40932e87663fb..d48b9d173760d436b56a50d48d2b827fe700dc7f 100644 (file)
@@ -3,6 +3,8 @@ from cStringIO import StringIO
 import os
 import logging
 import configobj
+import getpass
+import socket
 import time
 import urllib2
 import urlparse
@@ -292,3 +294,6 @@ def get_clients(ctx, roles):
         id_ = role[len(PREFIX):]
         (remote,) = ctx.cluster.only(role).remotes.iterkeys()
         yield (id_, remote)
+
+def get_user():
+    return getpass.getuser() + '@' + socket.gethostname()
index 2c91ab373ca580b1e579bf5f62e1100e88cd6501..d96f71f1fee4376e17ab98f97c6aedc447f5267d 100644 (file)
@@ -1,8 +1,6 @@
 import argparse
 import os
 import yaml
-import getpass
-import socket
 
 def config_file(string):
     config = {}
@@ -105,7 +103,8 @@ def main():
     if ctx.owner is not None:
         ctx.summary['owner'] = ctx.owner
     else:
-        ctx.summary['owner'] = getpass.getuser() + '@' + socket.gethostname()
+        from teuthology.misc import get_user
+        ctx.summary['owner'] = get_user()
 
     if ctx.description is not None:
         ctx.summary['description'] = ctx.description