~hopem/charms/trusty/swift-proxy/lp1518975

« back to all changes in this revision

Viewing changes to tests/charmhelpers/contrib/amulet/utils.py

  • Committer: Christopher Glass
  • Date: 2015-09-11 07:30:34 UTC
  • mfrom: (107.2.8 add-pause-resume-actions)
  • Revision ID: christopher.glass@canonical.com-20150911073034-hkn326duunz2y63q
Merge lp:~adam-collard/charms/trusty/swift-proxy/add-pause-resume-actions [a=adam-collard] [r=tribaal, tealeg]

Add actions for pausing and resuming services on swift-storage units.

Show diffs side-by-side

added added

removed removed

Lines of Context:
594
594
        output = _check_output(command, universal_newlines=True)
595
595
        data = json.loads(output)
596
596
        return data.get(u"status") == "completed"
 
597
 
 
598
    def status_get(self, unit):
 
599
        """Return the current service status of this unit."""
 
600
        raw_status, return_code = unit.run(
 
601
            "status-get --format=json --include-data")
 
602
        if return_code != 0:
 
603
            return ("unknown", "")
 
604
        status = json.loads(raw_status)
 
605
        return (status["status"], status["message"])