diff --git a/nova_powervm/conf/powervm.py b/nova_powervm/conf/powervm.py index aa5d204a..ab48757b 100644 --- a/nova_powervm/conf/powervm.py +++ b/nova_powervm/conf/powervm.py @@ -204,7 +204,10 @@ swift_opts = [ cfg.StrOpt('swift_auth_url', help='The Keystone authorization url. ' 'Example: "http://keystone-hostname:5000/v3"'), cfg.StrOpt('swift_cacert', required=False, help='Path to CA certificate ' - 'file. Example: /etc/swiftclient/myca.pem') + 'file. Example: /etc/swiftclient/myca.pem'), + cfg.StrOpt('swift_endpoint_type', help='The endpoint/interface type for ' + 'the Swift client to select from the Keystone Service Catalog ' + 'for the connection URL. Swift defaults to "publicURL".') ] vnc_opts = [ diff --git a/nova_powervm/tests/virt/powervm/nvram/test_swift.py b/nova_powervm/tests/virt/powervm/nvram/test_swift.py index c8cc69b2..c6546811 100644 --- a/nova_powervm/tests/virt/powervm/nvram/test_swift.py +++ b/nova_powervm/tests/virt/powervm/nvram/test_swift.py @@ -313,7 +313,11 @@ class TestSwiftStore(test.TestCase): """Test optional config values.""" # Not in the sparse one from setUp() self.assertIsNone(self.swift_store.options['os_cacert']) + self.assertIsNone(self.swift_store.options['os_endpoint_type']) # Create a new one with the optional values set self.flags(swift_cacert='/path/to/ca.pem', group='powervm') + self.flags(swift_endpoint_type='internalURL', group='powervm') swift_store = swift.SwiftNvramStore() self.assertEqual('/path/to/ca.pem', swift_store.options['os_cacert']) + self.assertEqual('internalURL', + swift_store.options['os_endpoint_type']) diff --git a/nova_powervm/virt/powervm/nvram/swift.py b/nova_powervm/virt/powervm/nvram/swift.py index 1a2dc045..94b1102a 100644 --- a/nova_powervm/virt/powervm/nvram/swift.py +++ b/nova_powervm/virt/powervm/nvram/swift.py @@ -65,6 +65,7 @@ class SwiftNvramStore(api.NvramStore): 'os_project_domain_name': CONF.powervm.swift_project_domain_name, 'os_auth_url': CONF.powervm.swift_auth_url, 'os_cacert': CONF.powervm.swift_cacert, + 'os_endpoint_type': CONF.powervm.swift_endpoint_type, } return options