~dpb/charms/precise/haproxy/fixes

« back to all changes in this revision

Viewing changes to hooks/hooks.py

  • Committer: David Britton
  • Date: 2013-02-13 23:57:05 UTC
  • Revision ID: dpb@canonical.com-20130213235705-dsa2c09q7wc2hd13
revert test code commit

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
    log_args.extend(args)
38
38
    subprocess.call(log_args)
39
39
 
40
 
def relation_set(*args):
41
 
    """
42
 
    Arguments passed through unaltered to relation_set
43
 
    """
44
 
    set_args = ["relation-set"]
45
 
    set_args.extend(args)
46
 
    subprocess.call(set_args)
47
 
 
48
40
#------------------------------------------------------------------------------
49
41
# config_get:  Returns a dictionary containing all of the config information
50
42
#              Optional parameter: scope
690
682
    # hostname
691
683
    if my_host == "localhost":
692
684
        my_host = socket.gethostname()
693
 
    relation_set(
694
 
            ['port=%d' % my_port, 'hostname=%s' % my_host,
 
685
    subprocess.call(
 
686
            ['relation-set', 'port=%d' % my_port, 'hostname=%s' % my_host,
695
687
             'all_services=%s' % yaml.dump(get_all_services())])
696
688
    if hook_name == "changed":
697
689
        if 'is-proxy' in relation_data: