Set AuthPlugin in __init__()

self.auth_plugin should be set in __init__()

Change-Id: Ib23fd14a697e4a03acd8c62cf1b09670d169a115
This commit is contained in:
Chaozhe.Chen
2015-12-02 13:50:52 +08:00
parent 6dbfc4502e
commit 236bf8b307

View File

@@ -54,6 +54,9 @@ def _positive_non_zero_int(argument_value):
class CloudkittyShell(object):
def __init__(self):
self.auth_plugin = ckclient.AuthPlugin()
def get_base_parser(self):
parser = argparse.ArgumentParser(
prog='cloudkitty',
@@ -174,7 +177,6 @@ class CloudkittyShell(object):
def parse_args(self, argv):
# Parse args once to find version
self.auth_plugin = ckclient.AuthPlugin()
parser = self.get_base_parser()
(options, args) = parser.parse_known_args(argv)
self.auth_plugin.parse_opts(options)