~jimbaker/pyjuju/new-hook-semantics-3-remove-change-hook

« back to all changes in this revision

Viewing changes to bin/ensemble-log

[merge] Merge relation-get-args branch. [r=niemeyer] [f=719329]

* relation-get now follows the specification for argument ordering.
   The documented format is: 
  
    relation-get [setting_name] [unitname]
  
    '-' may be used for setting_name to indicate ALL relation settings.
    unitname may be ommited and now defaults to the remote unit of the relationship.

* many cleanups to the tests and removal of many testing hook files from the tree

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
 
 
3
 
from ensemble.hooks.cli import CommandLineClient
4
 
from twisted.internet.defer import inlineCallbacks, returnValue
5
 
 
6
 
class LoggingCli(CommandLineClient):
7
 
    keyvalue_pairs = False
8
 
    require_cid = False
9
 
 
10
 
    def customize_parser(self):
11
 
        self.parser.add_argument("message", nargs="+")
12
 
 
13
 
    def run(self, result=None):
14
 
        return self.client.log(self.options.log_level,
15
 
                               self.options.message)
16
 
 
 
2
from ensemble.hooks.commands import log
17
3
 
18
4
if __name__ == '__main__':
19
 
    import sys
20
 
    client = LoggingCli()
21
 
    sys.exit(client())
 
5
    log()