~bcsaller/pyjuju/status-state-nodes

« back to all changes in this revision

Viewing changes to ensemble/state/service.py

  • Committer: Benjamin Saller
  • Date: 2011-01-27 18:20:36 UTC
  • Revision ID: bcsaller@gmail.com-20110127182036-gvgtgxsuf93pxqfz
use _internal_id_to_id for machine id conversion
tests for get_all_unit_states
more method pattern renames

Show diffs side-by-side

added added

removed removed

Lines of Context:
227
227
                                     internal_unit_id))
228
228
 
229
229
    @inlineCallbacks
230
 
    def get_units(self):
 
230
    def get_all_unit_states(self):
231
231
        """Return a list of ServiceUnitState instances associated with
232
232
        this service.
233
233
        """
357
357
        self._unit_sequence = unit_sequence
358
358
        self._internal_id = internal_id
359
359
 
 
360
    def __hash__(self):
 
361
        return hash(self.unit_name)
 
362
 
 
363
    def __eq__(self, other):
 
364
        if not isinstance(other, ServiceUnitState):
 
365
            return False
 
366
        return self.unit_name == other.unit_name
 
367
 
 
368
    def __repr__(self):
 
369
        return "<%s %s>" % (self.__class__.__name__,
 
370
                            self.unit_name)
 
371
 
360
372
    @inlineCallbacks
361
373
    def as_dict(self):
362
374
        returnValue(