From 456f96f95719985a76a1b73b79326c1febdd5d35 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Thu, 30 May 2013 16:47:48 -0700 Subject: [PATCH] ceph: remove global declarations, declare verbose and cluster near top Signed-off-by: Dan Mick --- src/ceph | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ceph b/src/ceph index a85f01c3f33..5c03e3c7645 100755 --- 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