From e366712aca164a6d504695b0e5ea898580ff4654 Mon Sep 17 00:00:00 2001 From: Paul Durivage Date: Fri, 27 Sep 2013 15:50:32 -0500 Subject: [PATCH 1/2] Use set_setting; alleviates pyrax requiring the ~/pyrax.cfg in order to establish identity_type --- plugins/inventory/rax.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/inventory/rax.py b/plugins/inventory/rax.py index 283486ef14..5acb6050a6 100755 --- a/plugins/inventory/rax.py +++ b/plugins/inventory/rax.py @@ -112,6 +112,8 @@ except KeyError, e: sys.stderr.write('Unable to load %s\n' % e.message) sys.exit(1) +pyrax.set_setting('identity_type', 'rackspace') + try: pyrax.set_credential_file(os.path.expanduser(creds_file), region=region) From 532c7db03b90b54b8859d764084f79cd3ee7e50b Mon Sep 17 00:00:00 2001 From: Paul Durivage Date: Fri, 27 Sep 2013 15:51:07 -0500 Subject: [PATCH 2/2] Update example to use RAX_CREDS_FILE env var --- plugins/inventory/rax.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/inventory/rax.py b/plugins/inventory/rax.py index 5acb6050a6..abfc90dd51 100755 --- a/plugins/inventory/rax.py +++ b/plugins/inventory/rax.py @@ -70,9 +70,9 @@ notes: requirements: [ "pyrax" ] examples: - description: List server instances - code: RAX_CREDS=~/.raxpub RAX_REGION=ORD rax.py --list + code: RAX_CREDS_FILE=~/.raxpub RAX_REGION=ORD rax.py --list - description: List server instance properties - code: RAX_CREDS=~/.raxpub RAX_REGION=ORD rax.py --host + code: RAX_CREDS_FILE=~/.raxpub RAX_REGION=ORD rax.py --host ''' import sys