~therve/pyjuju/validate-config-values

« back to all changes in this revision

Viewing changes to juju/hooks/commands.py

  • Committer: Jim Baker
  • Date: 2012-04-05 16:24:31 UTC
  • mfrom: (485.3.15 relation-ids-command)
  • Revision ID: jim.baker@canonical.com-20120405162431-c5dw8y2myg7g2n0p
merge relation-ids-command [r=hazmat][f=963643]

Implments the relation-ids hook command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
    sys.exit(client())
87
87
 
88
88
 
 
89
class RelationIdsCli(CommandLineClient):
 
90
    keyvalue_pairs = False
 
91
 
 
92
    def customize_parser(self):
 
93
        self.parser.add_argument(
 
94
            "relation_name",
 
95
            metavar="RELATION NAME",
 
96
            nargs="?",
 
97
            default="",
 
98
            help="Specify the relation name of the relation ids to list.")
 
99
 
 
100
    def run(self):
 
101
        return self.client.relation_ids(
 
102
            self.options.client_id, self.options.relation_name)
 
103
 
 
104
 
 
105
def relation_ids():
 
106
    """Entry point for relation-set."""
 
107
    client = RelationIdsCli()
 
108
    sys.exit(client())
 
109
 
 
110
 
89
111
class ListCli(CommandLineClient):
90
112
    keyvalue_pairs = False
91
113