mirror of
https://github.com/ceph/ceph
synced 2025-03-11 02:39:05 +00:00
Move username to a utility method.
This commit is contained in:
parent
dbf5e54307
commit
09bee43593
@ -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()
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user