Merge pull request #5 from openstack-charmers/revert-a014d075e7d67d391b7640f74ac95245a769815c
Revert "modified to fix the issue where deployment failed."
This commit is contained in:
commit
e4be06f98a
@ -1,5 +1,5 @@
|
||||
import charms_openstack.charm
|
||||
import charmhelpers.core.hookenv as ch_hookenv # noqa
|
||||
import charmhelpers.core.hookenv as ch_hookenv
|
||||
|
||||
charms_openstack.charm.use_defaults('charm.default-select-release')
|
||||
|
||||
@ -14,19 +14,20 @@ class CinderpurestorageCharm(
|
||||
stateless = True
|
||||
# Specify any config that the user *must* set.
|
||||
mandatory_config = [
|
||||
'san-ip', 'pure-api-token', 'protocol']
|
||||
('san_ip', self.config.get('san-ip')),
|
||||
('pure_api_token', self.config.get('pure-api-token'))
|
||||
]
|
||||
|
||||
def cinder_configuration(self):
|
||||
drivers = {
|
||||
'iscsi': 'cinder.volume.drivers.pure.PureISCSIDriver',
|
||||
'fc': 'cinder.volume.drivers.pure.PureFCDriver',
|
||||
}
|
||||
service = self.config.get('volume-backend-name')
|
||||
volumedriver = drivers.get(self.config.get('protocol'))
|
||||
service = self.config.get('volume-backend-name') or service_name()
|
||||
driver_options = [
|
||||
('san_ip', self.config.get('san-ip')),
|
||||
('pure_api_token', self.config.get('pure-api-token')),
|
||||
('volume_driver', volumedriver),
|
||||
('volume_driver', drivers[self.config.get('protocol').lower()]),
|
||||
('volume_backend_name', service)]
|
||||
return driver_options
|
||||
|
||||
|
@ -17,8 +17,7 @@ import charms.reactive
|
||||
|
||||
# This charm's library contains all of the handler code associated with
|
||||
# this charm -- we need to import it to get the definitions for the charm.
|
||||
|
||||
import charm.openstack.cinder_purestorage # noqa
|
||||
import charm.openstack.cinder_purestorage
|
||||
|
||||
charms_openstack.charm.use_defaults(
|
||||
'charm.installed',
|
||||
@ -30,5 +29,5 @@ charms_openstack.charm.use_defaults(
|
||||
|
||||
@charms.reactive.when('config.changed.driver-source')
|
||||
def reinstall():
|
||||
with charms_openstack.charm.provide_charm_instance() as purestorage:
|
||||
purestorage.install()
|
||||
with charms_openstack.charm.provide_charm_instance() as charm:
|
||||
charm.install()
|
||||
|
4
tox.ini
4
tox.ini
@ -9,7 +9,7 @@ envlist = pep8,py3
|
||||
setenv = VIRTUAL_ENV={envdir}
|
||||
PYTHONHASHSEED=0
|
||||
TERM=linux
|
||||
CHARM_LAYERS_DIR={toxinidir}/layers
|
||||
LAYER_PATH={toxinidir}/layers
|
||||
JUJU_REPOSITORY={toxinidir}/build
|
||||
passenv = http_proxy https_proxy INTERFACE_PATH
|
||||
install_command =
|
||||
@ -76,4 +76,4 @@ commands = {posargs}
|
||||
|
||||
[flake8]
|
||||
# E402 ignore necessary for path append before sys module import in actions
|
||||
ignore = E402
|
||||
ignore = E402
|
@ -46,7 +46,4 @@ class TestCinderpurestorageCharm(test_utils.PatchHelper):
|
||||
charm = self._patch_config_and_charm({'a': 'b'})
|
||||
config = charm.cinder_configuration()
|
||||
# Add check here that configuration is as expected.
|
||||
self.assertEqual(config, [('san_ip', None),
|
||||
('pure_api_token', None),
|
||||
('volume_driver', None),
|
||||
('volume_backend_name', None)])
|
||||
# self.assertEqual(config, {})
|
||||
|
Loading…
x
Reference in New Issue
Block a user