Merge "Modify the keys used for package installation in cinder plugins"
This commit is contained in:
commit
c4cdbf9d77
@ -15,6 +15,11 @@
|
|||||||
import json
|
import json
|
||||||
|
|
||||||
import ops_openstack.core
|
import ops_openstack.core
|
||||||
|
from charmhelpers.fetch import (
|
||||||
|
apt_install,
|
||||||
|
apt_update,
|
||||||
|
add_source
|
||||||
|
)
|
||||||
# ch_context needed for bluestore validation
|
# ch_context needed for bluestore validation
|
||||||
import charmhelpers.contrib.openstack.context as ch_context
|
import charmhelpers.contrib.openstack.context as ch_context
|
||||||
from ops.model import (
|
from ops.model import (
|
||||||
@ -89,6 +94,14 @@ class CinderStoragePluginCharm(ops_openstack.core.OSBaseCharm):
|
|||||||
self.set_data(relation.data[self.unit], config, app_name)
|
self.set_data(relation.data[self.unit], config, app_name)
|
||||||
self.unit.status = ActiveStatus('Unit is ready')
|
self.unit.status = ActiveStatus('Unit is ready')
|
||||||
|
|
||||||
|
def on_install(self, _):
|
||||||
|
source = self.model.config.get('driver-source')
|
||||||
|
if source:
|
||||||
|
add_source(source, self.model.config.get('driver-key'))
|
||||||
|
apt_update(fatal=True)
|
||||||
|
apt_install(self.PACKAGES, fatal=True)
|
||||||
|
self.update_status()
|
||||||
|
|
||||||
def on_storage_backend(self, event):
|
def on_storage_backend(self, event):
|
||||||
self.set_data(
|
self.set_data(
|
||||||
event.relation.data[self.unit],
|
event.relation.data[self.unit],
|
||||||
|
Loading…
Reference in New Issue
Block a user