Skip to content

Commit d2473c2

Browse files
committed
Add update_storage_pool
1 parent f64115d commit d2473c2

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

juju/model.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -916,6 +916,23 @@ async def remove_storage_pool(self, name):
916916
storage_facade = client.StorageFacade.from_connection(self.connection)
917917
return await storage_facade.RemovePool(pools=[name])
918918

919+
async def update_storage_pool(self, name, attributes=""):
920+
""" Update storage pool attributes.
921+
922+
:param name:
923+
:param attributes: "key=value key=value ..."
924+
:return:
925+
"""
926+
_attrs = dict([splt.split("=") for splt in attributes.split()])
927+
if len(_attrs) == 0:
928+
raise JujuError("Expected at least one attribute to update")
929+
930+
storage_facade = client.StorageFacade.from_connection(self.connection)
931+
return await storage_facade.UpdatePool(pools=[client.StoragePool(
932+
name=name,
933+
attrs=_attrs,
934+
)])
935+
919936
async def remove_storage(self, force=False, destroy_storage=False, *storage_ids):
920937
"""Removes storage from the model.
921938

0 commit comments

Comments
 (0)