Skip to content
Permalink
Browse files

Adapt internal and exposed properties to the multi-kind reality

Not all objects are services (ex: usr, sec, ...).

* BaseSvc::svcname => BaseSvc::name
* BaseSvc::svcpath => BaseSvc::path
* Make the API accept the "path" option where it accepted "svcpath"
(backward compatible with "svcpath" and "svcname")
* rcUtilities::fmt_svcpath() => rcUtilities::fmt_path()
* rcUtilities::resolve_svcpath() => rcUtilities::resolve_path()
* rcUtilities::split_svcpath() => rcUtilities::split_path()

This patch bumps the compat version to 10.
  • Loading branch information...
cvaroqui committed Jul 8, 2019
1 parent 9021cd4 commit f26d47d8b0e9c92d3d36849a65b2934243b75a31
Showing with 1,688 additions and 1,704 deletions.
  1. +1 −1 lib/cfgdict.py
  2. +2 −2 lib/checkAdvfsUsageOSF1.py
  3. +2 −2 lib/checkBtrfsDevStatsLinux.py
  4. +4 −4 lib/checkEthHP-UX.py
  5. +4 −4 lib/checkEthLinux.py
  6. +6 −6 lib/checkEthSunOS.py
  7. +1 −1 lib/checkFmFmadm.py
  8. +1 −1 lib/checkFmOpenManage.py
  9. +2 −2 lib/checkFsInodeAIX.py
  10. +2 −2 lib/checkFsInodeDarwin.py
  11. +3 −3 lib/checkFsInodeHP-UX.py
  12. +2 −2 lib/checkFsInodeLinux.py
  13. +2 −2 lib/checkFsInodeSunOS.py
  14. +2 −2 lib/checkFsUsageAIX.py
  15. +2 −2 lib/checkFsUsageDarwin.py
  16. +2 −2 lib/checkFsUsageFreeBSD.py
  17. +2 −2 lib/checkFsUsageHP-UX.py
  18. +5 −5 lib/checkFsUsageLinux.py
  19. +5 −5 lib/checkFsUsageSunOS.py
  20. +2 −2 lib/checkFsUsageWindows.py
  21. +3 −3 lib/checkJstatLinux.py
  22. +1 −1 lib/checkLagHP-UX.py
  23. +3 −3 lib/checkLagLinux.py
  24. +4 −4 lib/checkLagSunOS.py
  25. +1 −1 lib/checkLagWindows.py
  26. +1 −1 lib/checkMceLinux.py
  27. +3 −3 lib/checkMpathAIX.py
  28. +3 −3 lib/checkMpathHP-UX.py
  29. +5 −5 lib/checkMpathLinux.py
  30. +2 −2 lib/checkMpathOSF1.py
  31. +2 −2 lib/checkMpathPowerpath.py
  32. +2 −2 lib/checkMpathSunOS.py
  33. +2 −2 lib/checkMpathWindows.py
  34. +1 −1 lib/checkNumaLinux.py
  35. +6 −6 lib/checkRaidMegaRaid.py
  36. +7 −7 lib/checkRaidSas2.py
  37. +1 −1 lib/checkRaidSmartArray.py
  38. +3 −3 lib/checkSync.py
  39. +2 −2 lib/checkVgUsageAIX.py
  40. +2 −2 lib/checkVgUsageHP-UX.py
  41. +2 −2 lib/checkVgUsageLinux.py
  42. +6 −6 lib/checkZfsUsageSunOS.py
  43. +2 −2 lib/checkZpoolSunOS.py
  44. +4 −4 lib/checks.py
  45. +1 −1 lib/cluster.py
  46. +1 −1 lib/clusterdict.py
  47. +36 −36 lib/collector.py
  48. +12 −12 lib/compliance.py
  49. +5 −5 lib/data.py
  50. +16 −16 lib/extconfig.py
  51. +49 −49 lib/fmt_cluster.py
  52. +36 −36 lib/fmt_service.py
  53. +2 −2 lib/freezer.py
  54. +11 −11 lib/mgr.py
  55. +1 −1 lib/mgr_parser.py
  56. +132 −132 lib/node.py
  57. +2 −2 lib/nodedict.py
  58. +41 −41 lib/osvcd_collector.py
  59. +22 −22 lib/osvcd_dns.py
  60. +138 −154 lib/osvcd_lsnr.py
  61. +651 −651 lib/osvcd_mon.py
  62. +38 −38 lib/osvcd_scheduler.py
  63. +87 −87 lib/osvcd_shared.py
  64. +5 −5 lib/pool.py
  65. +3 −3 lib/poolVirtual.py
  66. +1 −1 lib/provContainerLxc.py
  67. +1 −1 lib/provContainerZone.py
  68. +3 −3 lib/provFsBtrfs.py
  69. +2 −2 lib/provKvm.py
  70. +12 −12 lib/provVolume.py
  71. +2 −2 lib/rcCentera.py
  72. +1 −1 lib/rcCloud.py
  73. +3 −3 lib/rcCloudAmazon.py
  74. +3 −3 lib/rcCloudGandi.py
  75. +4 −4 lib/rcCloudOpenstack.py
  76. +5 −5 lib/rcCloudVcloud.py
  77. +8 −8 lib/rcContainer.py
  78. +2 −2 lib/rcEmcVnx.py
  79. +2 −2 lib/rcEva.py
  80. +2 −2 lib/rcFreenas.py
  81. +2 −2 lib/rcHds.py
  82. +3 −3 lib/rcHp3par.py
  83. +1 −1 lib/rcLogger.py
  84. +2 −2 lib/rcNetapp.py
  85. +2 −2 lib/rcNexenta.py
  86. +9 −9 lib/rcPgLinux.py
  87. +2 −2 lib/rcSymmetrix.py
  88. +16 −16 lib/rcUtilities.py
  89. +2 −2 lib/rcXtremio.py
  90. +6 −3 lib/resApp.py
  91. +3 −3 lib/resContainer.py
  92. +1 −1 lib/resContainerDocker.py
  93. +2 −2 lib/resDiskGce.py
  94. +2 −2 lib/resDiskMdLinux.py
  95. +1 −1 lib/resDiskRaw.py
  96. +2 −2 lib/resFsDocker.py
  97. +1 −4 lib/resIp.py
  98. +4 −4 lib/resSync.py
  99. +3 −3 lib/resSyncDocker.py
  100. +2 −2 lib/resSyncHp3par.py
  101. +1 −1 lib/resSyncHp3parSnap.py
  102. +2 −2 lib/resSyncS3.py
  103. +6 −6 lib/resVolume.py
  104. +3 −3 lib/resources.py
  105. +1 −1 lib/resourceset.py
  106. +2 −2 lib/sec.py
  107. +1 −1 lib/secdict.py
  108. +1 −1 lib/snapAdvfsOSF1.py
  109. +82 −82 lib/svc.py
  110. +31 −31 lib/svcBuilder.py
  111. +12 −12 lib/svcdict.py
  112. +3 −3 lib/svcmgr_parser.py
  113. +5 −5 lib/svcmon.py
  114. +4 −4 lib/usr.py
  115. +1 −1 lib/usrdict.py
  116. +7 −7 lib/xmlrpcClient.py
@@ -34,7 +34,7 @@
"candidates": (True, False),
"default": False,
"convert": "boolean",
"text": "A disabled resource will be ignored on service startup and shutdown. Its status is always reported ``n/a``.\n\nSet in DEFAULT, the whole service is disabled. A disabled service does not honor start and stop actions. These actions immediately return success.\n\n:cmd:`sudo svcmgr -s <svcname> disable` only sets :kw:`DEFAULT.disable`. As resources disabled state is not changed, :cmd:`sudo svcmgr -s <svcname> enable` does not enable disabled resources."
"text": "A disabled resource will be ignored on service startup and shutdown. Its status is always reported ``n/a``.\n\nSet in DEFAULT, the whole service is disabled. A disabled service does not honor start and stop actions. These actions immediately return success.\n\n:cmd:`sudo svcmgr -s <path> disable` only sets :kw:`DEFAULT.disable`. As resources disabled state is not changed, :cmd:`sudo svcmgr -s <path> enable` does not enable disabled resources."
},
{
"section": "DEFAULT",
@@ -17,7 +17,7 @@ def find_svc(self, name):
if not hasattr(resource, "poolname"):
continue
if resource.poolname == name:
return svc.svcpath
return svc.path
return ""

def do_check(self):
@@ -29,7 +29,7 @@ def do_check(self):
r.append({
"instance": dom,
"value": str(d.used_pct),
"svcpath": self.find_svc(dom),
"path": self.find_svc(dom),
})
except rcAdvfs.ExInit:
pass
@@ -71,7 +71,7 @@ def get_btrfs_mounts(self):
def find_svc(self, dev):
for svc in self.svcs:
if dev in svc.sub_devs():
return svc.svcpath
return svc.path
return ''

def do_check(self):
@@ -83,7 +83,7 @@ def do_check(self):
for err_type, val in _data.items():
r.append({"instance": dev+'.'+err_type,
"value": val,
"svcpath": self.find_svc(dev),
"path": self.find_svc(dev),
})
return r

@@ -62,7 +62,7 @@ def do_check_intf(self, intf):
r.append({
"instance": inst,
"value": val,
"svcpath": "",
"path": "",
})

inst = intf + ".speed"
@@ -77,7 +77,7 @@ def do_check_intf(self, intf):
r.append({
"instance": inst,
"value": val,
"svcpath": "",
"path": "",
})

inst = intf + ".autoneg"
@@ -90,7 +90,7 @@ def do_check_intf(self, intf):
r.append({
"instance": inst,
"value": val,
"svcpath": "",
"path": "",
})

inst = intf + ".duplex"
@@ -103,7 +103,7 @@ def do_check_intf(self, intf):
r.append({
"instance": inst,
"value": val,
"svcpath": "",
"path": "",
})

return r
@@ -64,7 +64,7 @@ def do_check_intf(self, intf):
r.append({
"instance": inst,
"value": val,
"svcpath": '',
"path": '',
})

inst = intf + ".autoneg"
@@ -78,7 +78,7 @@ def do_check_intf(self, intf):
r.append({
"instance": inst,
"value": val,
"svcpath": '',
"path": '',
})

inst = intf + ".duplex"
@@ -92,7 +92,7 @@ def do_check_intf(self, intf):
r.append({
"instance": inst,
"value": val,
"svcpath": '',
"path": '',
})

inst = intf + ".link"
@@ -105,7 +105,7 @@ def do_check_intf(self, intf):
r.append({
"instance": inst,
"value": val,
"svcpath": '',
"path": '',
})

return r
@@ -179,15 +179,15 @@ def do_check_speed(self):
r.append({
"instance": '%s.%s.speed' % (ifn, self.phys[phy]["device"]),
"value": str(self.phys[phy]["speed"]),
"svcpath": '',
"path": '',
})
return r
for ifn in self.ifs:
val = self.get_param(ifn, 'link_speed')
r.append({
"instance": '%s.speed'%ifn,
"value": str(val),
"svcpath": '',
"path": '',
})
return r

@@ -204,15 +204,15 @@ def do_check_duplex(self):
r.append({
"instance": '%s.%s.duplex' % (ifn, self.phys[phy]["device"]),
"value": val,
"svcpath": '',
"path": '',
})
return r
for ifn in self.ifs:
val = self.get_param(ifn, 'link_duplex')
r.append({
"instance": '%s.duplex'%ifn,
"value": str(val),
"svcpath": '',
"path": '',
})
return r

@@ -229,15 +229,15 @@ def do_check_link(self):
r.append({
"instance": '%s.%s.link' % (ifn, self.phys[phy]["device"]),
"value": val,
"svcpath": '',
"path": '',
})
return r
for ifn in self.ifs:
val = self.get_param(ifn, 'link_status')
r.append({
"instance": '%s.link'%ifn,
"value": str(val),
"svcpath": '',
"path": '',
})
return r

@@ -35,6 +35,6 @@ def do_check_ldpdinfo(self):
r.append({
"instance": 'faults ',
"value": str(len(out)),
"svcpath": '',
"path": '',
})
return r
@@ -51,6 +51,6 @@ def do_check_gen(self, command):
r.append({
"instance": inst,
"value": str(state),
"svcpath": '',
"path": '',
})
return r
@@ -10,7 +10,7 @@ def find_svc(self, mountpt):
if not hasattr(resource, "mount_point"):
continue
if resource.mount_point == mountpt:
return svc.svcpath
return svc.path
return ''

def do_check(self):
@@ -33,6 +33,6 @@ def do_check(self):
r.append({
"instance": l[6],
"value": l[5],
"svcpath": self.find_svc(l[6]),
"path": self.find_svc(l[6]),
})
return r
@@ -10,7 +10,7 @@ def find_svc(self, mountpt):
if not hasattr(resource, "mount_point"):
continue
if resource.mount_point == mountpt:
return svc.svcpath
return svc.path
return ''

def do_check(self):
@@ -31,6 +31,6 @@ def do_check(self):
r.append({
"instance": l[8],
"value": l[7],
"svcpath": self.find_svc(l[8]),
"path": self.find_svc(l[8]),
})
return r
@@ -10,7 +10,7 @@ def find_svc(self, mountpt):
if not hasattr(resource, "mount_point"):
continue
if resource.mount_point == mountpt:
return svc.svcpath
return svc.path
return ''

def do_check(self):
@@ -33,14 +33,14 @@ def do_check(self):
inst = ' '.join(l[8:])
r.append({"instance": inst,
"value": l[7],
"svcpath": self.find_svc(inst),
"path": self.find_svc(inst),
}
)
elif len(l) == 8:
inst = ' '.join(l[7:])
r.append({"instance": inst,
"value": l[6],
"svcpath": self.find_svc(inst),
"path": self.find_svc(inst),
}
)
return r
@@ -10,7 +10,7 @@ def find_svc(self, mountpt):
if not hasattr(resource, "mount_point"):
continue
if resource.mount_point == mountpt:
return svc.svcpath
return svc.path
return ''

def do_check(self):
@@ -60,6 +60,6 @@ def do_check(self):
r.append({
"instance": l[5],
"value": l[4],
"svcpath": self.find_svc(l[5]),
"path": self.find_svc(l[5]),
})
return r
@@ -10,7 +10,7 @@ def find_svc(self, mountpt):
if not hasattr(resource, "mount_point"):
continue
if resource.mount_point == mountpt:
return svc.svcpath
return svc.path
return ''

def do_check(self):
@@ -37,6 +37,6 @@ def _do_check(self, t):
r.append({
"instance": l[5],
"value": l[4],
"svcpath": self.find_svc(l[5]),
"path": self.find_svc(l[5]),
})
return r
@@ -10,7 +10,7 @@ def find_svc(self, mountpt):
if not hasattr(resource, "mount_point"):
continue
if resource.mount_point == mountpt:
return svc.svcpath
return svc.path
return ''

def do_check(self):
@@ -33,6 +33,6 @@ def do_check(self):
r.append({
"instance": l[5],
"value": l[4],
"svcpath": self.find_svc(l[5]),
"path": self.find_svc(l[5]),
})
return r
@@ -10,7 +10,7 @@ def find_svc(self, mountpt):
if not hasattr(resource, "mount_point"):
continue
if resource.mount_point == mountpt:
return svc.svcpath
return svc.path
return ''

def do_check(self):
@@ -43,6 +43,6 @@ def do_check(self):
r.append({
"instance": l[5],
"value": l[4],
"svcpath": self.find_svc(l[5]),
"path": self.find_svc(l[5]),
})
return r
@@ -10,7 +10,7 @@ def find_svc(self, mountpt):
if not hasattr(resource, "mount_point"):
continue
if resource.mount_point == mountpt:
return svc.svcpath
return svc.path
return ''

def do_check(self):
@@ -43,6 +43,6 @@ def do_check(self):
r.append({
"instance": l[5],
"value": l[4],
"svcpath": self.find_svc(l[5]),
"path": self.find_svc(l[5]),
})
return r
@@ -10,7 +10,7 @@ def find_svc(self, mountpt):
if not hasattr(resource, "mount_point"):
continue
if resource.mount_point == mountpt:
return svc.svcpath
return svc.path
return ''

def do_check(self):
@@ -43,6 +43,6 @@ def do_check(self):
r.append({
"instance": l[5],
"value": l[4],
"svcpath": self.find_svc(l[5]),
"path": self.find_svc(l[5]),
})
return r
@@ -11,7 +11,7 @@ def find_svc(self, mountpt):
if not hasattr(resource, "mount_point"):
continue
if resource.mount_point == mountpt:
return svc.svcpath
return svc.path
return ''

def do_check(self):
@@ -55,20 +55,20 @@ def do_check(self):
if "osvc_sync_" in l[0]:
# do not report osvc sync snapshots fs usage
continue
svcpath = self.find_svc(l[5])
path = self.find_svc(l[5])
r.append({
"instance": l[5],
"value": l[4],
"svcpath": svcpath,
"path": path,
})
r.append({
"instance": l[5]+".free",
"value": l[3],
"svcpath": svcpath,
"path": path,
})
r.append({
"instance": l[5]+".size",
"value": l[1],
"svcpath": svcpath,
"path": path,
})
return r

0 comments on commit f26d47d

Please sign in to comment.
You can’t perform that action at this time.