~hazmat/pyjuju/security-policy-with-topology

« back to all changes in this revision

Viewing changes to ensemble/state/service.py

  • Committer: kapil.thangavelu at canonical
  • Date: 2011-08-04 15:10:28 UTC
  • Revision ID: kapil.thangavelu@canonical.com-20110804151028-yklekrj9hqq0bbap
add another security check around removing units, fix an old service test that running (missing inlinecallbacks)

Show diffs side-by-side

added added

removed removed

Lines of Context:
852
852
        """
853
853
 
854
854
        def unassign_unit(topology):
 
855
 
855
856
            if not topology.has_service(self._internal_service_id) or \
856
857
               not topology.has_service_unit(self._internal_service_id,
857
858
                                             self._internal_id):
865
866
            if machine_id is not None:
866
867
                topology.unassign_service_unit_from_machine(
867
868
                    self._internal_service_id, self._internal_id)
 
869
 
868
870
        return self._retry_topology_change(unassign_unit)
869
871
 
870
872
    @inlineCallbacks