~bbaqar/charms/trusty/neutron-api-plumgrid/temp

« back to all changes in this revision

Viewing changes to hooks/neutron_plumgrid_hooks.py

  • Committer: bbaqar at plumgrid
  • Date: 2015-08-09 15:32:44 UTC
  • Revision ID: bbaqar@plumgrid.com-20150809153244-y8r6mf93wr0tqgyn
Support added for metadata

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
 
62
62
 
63
63
@hooks.hook('neutron-plugin-api-relation-joined')
64
 
def neutron_plugin_api_joined():
65
 
    '''
66
 
    This hook is run when relation between neutron-api and
67
 
    neutron-api-plumgrid is made.
68
 
    '''
69
 
    ensure_files()
70
 
    CONFIGS.write_all()
71
 
 
72
 
 
 
64
@hooks.hook('plumgrid-plugin-relation-changed')
73
65
@hooks.hook('container-relation-changed')
74
66
@restart_on_change(restart_map())
75
 
def container_changed():
 
67
def relation_changed():
76
68
    '''
77
 
    This hook is run when relation between neutron-api and
78
 
    neutron-api-plumgrid is changed.
 
69
    This hook is run when relation between neutron-api-plumgrid and
 
70
    neutron-api or plumgrid-edge is made.
79
71
    '''
80
72
    ensure_files()
81
73
    CONFIGS.write_all()
91
83
        apt_purge(pkg, fatal=False)
92
84
 
93
85
 
94
 
@hooks.hook('start')
95
 
def start():
96
 
    '''
97
 
    This hook is run after all relations are joined.
98
 
    '''
99
 
    ensure_files()
100
 
 
101
 
 
102
86
def main():
103
87
    try:
104
88
        hooks.execute(sys.argv)