~niedbalski/charms/trusty/swift-storage/backport-fix-lp1510666

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/core/host.py

[adam-collard, r=gnuoy] Backport r436 to stable.

This branch prevents the swift-storage charm from thinking there was an OpenStack upgrade available at every config-changed.

I had to update the Amulet tests because they were incorrectly asserting that all of the swift services should have been restarted following a change to object-server-threads-per-disk. In fact, only the object services should be restarted, and only are (the test passed prior to this because of the bug in charm-helpers which caused the unconditional OpenStack upgrade, in turn restarting all of the services)

Show diffs side-by-side

added added

removed removed

Lines of Context:
72
72
    stopped = service_stop(service_name)
73
73
    # XXX: Support systemd too
74
74
    override_path = os.path.join(
75
 
        init_dir, '{}.conf.override'.format(service_name))
 
75
        init_dir, '{}.override'.format(service_name))
76
76
    with open(override_path, 'w') as fh:
77
77
        fh.write("manual\n")
78
78
    return stopped
86
86
    if init_dir is None:
87
87
        init_dir = "/etc/init"
88
88
    override_path = os.path.join(
89
 
        init_dir, '{}.conf.override'.format(service_name))
 
89
        init_dir, '{}.override'.format(service_name))
90
90
    if os.path.exists(override_path):
91
91
        os.unlink(override_path)
92
92
    started = service_start(service_name)