def setup_unit_change(self, unit_name, instance, change="joined"): if instance is None: unit_data = {} else: unit_data = {'private-address': instance.private_ip_address} unit = self.get_unit( unit_name, {unit_name: unit_data}, instance=instance) controller = Controller(unit) getattr(controller, "on_%s" % change)() config = unit.config_get() return controller.get_hostname(config)
def tearDown(self): unit = self.get_unit("foi", None) db = Controller(unit).get_db() db.delete()