~joeborg/charms/trusty/contrail-configuration/rbac-switch

« back to all changes in this revision

Viewing changes to hooks/contrail_configuration_utils.py

  • Committer: Robert Ayres
  • Date: 2016-10-20 23:59:42 UTC
  • Revision ID: robert.ayres@canonical.com-20161020235942-ihjgen12h2kae5q4
*Add supervisor files for contrail 3.1
*Alter ntpq script for contrail 3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
255
255
    pw = pwd.getpwnam("contrail")
256
256
    os.chown("/etc/contrail/supervisord_config_files/ifmap.ini", pw.pw_uid,
257
257
             pw.pw_gid)
258
 
    shutil.copy("files/ifmap", "/etc/init.d")
 
258
 
 
259
    src = "files/ifmap-3.1" \
 
260
          if version_compare(CONTRAIL_VERSION, "3.1") >= 0 \
 
261
          else "files/ifmap"
 
262
    shutil.copy(src, "/etc/init.d/ifmap")
259
263
    os.chmod("/etc/init.d/ifmap", 0755)
260
264
 
261
265
def fix_nodemgr():
262
266
    # add files missing from contrail-nodemgr package
263
 
    shutil.copy("files/contrail-nodemgr-config.ini",
264
 
                "/etc/contrail/supervisord_config_files")
 
267
    dest = "/etc/contrail/supervisord_config_files/" \
 
268
           + ("contrail-config-nodemgr.ini" \
 
269
              if version_compare(CONTRAIL_VERSION, "3.1") >= 0 \
 
270
              else "contrail-nodemgr-config.ini")
 
271
    shutil.copy("files/contrail-nodemgr-config.ini", dest)
265
272
    pw = pwd.getpwnam("contrail")
266
 
    os.chown("/etc/contrail/supervisord_config_files/contrail-nodemgr-config.ini",
267
 
             pw.pw_uid, pw.pw_gid)
268
 
    shutil.copy("files/contrail-config-nodemgr", "/etc/init.d")
 
273
    os.chown(dest, pw.pw_uid, pw.pw_gid)
 
274
 
 
275
    src = "files/contrail-config-nodemgr-3.1" \
 
276
          if version_compare(CONTRAIL_VERSION, "3.1") >= 0 \
 
277
          else "files/contrail-config-nodemgr"
 
278
    shutil.copy(src, "/etc/init.d/contrail-config-nodemgr")
269
279
    os.chmod("/etc/init.d/contrail-config-nodemgr", 0755)
270
280
 
271
281
    # fake ntp status when inside a container