Skip to content

Commit d1e7a5c

Browse files
committed
Fix unit.destroy() to use unit tag instead of name
Fixes #950
1 parent 15616c0 commit d1e7a5c

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

juju/unit.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def get_subordinates(self):
102102
return [u for u_name, u in self.model.units.items() if u.is_subordinate and
103103
u.principal_unit == self.name]
104104

105-
async def destroy(self):
105+
async def destroy(self, destroy_storage=False, dry_run=False, force=False, max_wait=None):
106106
"""Destroy this unit.
107107
108108
"""
@@ -111,7 +111,12 @@ async def destroy(self):
111111
log.debug(
112112
'Destroying %s', self.name)
113113

114-
return await app_facade.DestroyUnit(units=[{"unit-tag": self.name}])
114+
return await app_facade.DestroyUnit(units=[{"unit-tag": self.tag,
115+
'destroy-storage': destroy_storage,
116+
'force': force,
117+
'max-wait': max_wait,
118+
'dry-run': dry_run,
119+
}])
115120
remove = destroy
116121

117122
async def get_public_address(self):

0 commit comments

Comments
 (0)