]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph: remove global declarations, declare verbose and cluster near top
authorDan Mick <dan.mick@inktank.com>
Thu, 30 May 2013 23:47:48 +0000 (16:47 -0700)
committerDan Mick <dan.mick@inktank.com>
Tue, 4 Jun 2013 00:30:58 +0000 (17:30 -0700)
Signed-off-by: Dan Mick <dan.mick@inktank.com>
src/ceph

index a85f01c3f33475c6e0c7c5dd1d87d69c69bcc919..5c03e3c7645091787c7627a6ad7e2ab2f98eeefc 100755 (executable)
--- a/src/ceph
+++ b/src/ceph
@@ -17,7 +17,10 @@ import sys
 import types
 import uuid
 
+# just a couple of globals
+
 verbose = False
+cluster = None
 
 class ArgumentError(Exception):
     """
@@ -277,7 +280,6 @@ class CephPoolname(CephArgtype):
     Pool name; checked for presence in cluster
     """
     def valid(self, s, partial=False):
-        global cluster
         if cluster.pool.exists(s):
            raise ArgumentValid("pool {0} does not exist".format(s))
         self.val = s
@@ -1057,8 +1059,6 @@ def json_command(target=('mon', ''), prefix=None, argdict=None, inbuf='',
 
     If target is osd.N, send command to that osd (except for pgid cmds)
     """
-    global cluster
-    global verbose
     cmddict = {}
     if prefix:
         cmddict.update({'prefix':prefix})
@@ -1297,11 +1297,9 @@ def complete(sigdict, args, target):
 ###
 
 def main():
-    global cluster
 
     parsed_args, childargs = parse_cmdargs(first=False)
 
-    global verbose
     verbose = parsed_args.verbose
 
     # pass on --id, --name, -k, -c