oc-cdtapi 3.21.8__py3-none-any.whl → 3.22.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
oc_cdtapi/ForemanAPI.py CHANGED
@@ -1177,6 +1177,25 @@ class ForemanAPI(HttpAPI):
1177
1177
  logging.debug('Passing to get_host_uuid_v1')
1178
1178
  return self.get_host_uuid_v1(hostname)
1179
1179
 
1180
+ def get_host_disk_size(self, hostname):
1181
+ """
1182
+ :param hostname: str
1183
+ :return: int
1184
+ """
1185
+ logging.debug('Reached get_host_disk_size')
1186
+ response = self.get(posixpath.join("hosts", hostname, "vm_compute_attributes"))
1187
+ data = response.json()
1188
+ try:
1189
+ volumes = data.get("volumes_attributes", {})
1190
+ volume = volumes.get("0") or volumes.get(0)
1191
+ if volume and "size_gb" in volume:
1192
+ return int(volume["size_gb"])
1193
+ logging.error('Could not find size_gb in vm_compute_attributes for [%s]' % hostname)
1194
+ return None
1195
+ except (KeyError, ValueError, TypeError) as e:
1196
+ logging.error('Error parsing disk size for [%s]: %s' % (hostname, e))
1197
+ return None
1198
+
1180
1199
  def get_all_users(self):
1181
1200
  """
1182
1201
  :return: list
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oc-cdtapi
3
- Version: 3.21.8
3
+ Version: 3.22.1
4
4
  Summary: Custom Development python API libraries
5
5
  License: Apache2.0
6
6
  Requires-Python: >=3.6
@@ -3,7 +3,7 @@ oc_cdtapi/Dbsm2API.py,sha256=WDBst1dCAmDVU9d9Ogzwp2nkjtKZ4thU2xG4sAPI_Nk,9963
3
3
  oc_cdtapi/DevPIAPI.py,sha256=9WND9ld66eHmC5qoLJq3KDYSoO-pP69UqOQsGZNLZYg,1835
4
4
  oc_cdtapi/DmsAPI.py,sha256=eNFdwQLhCbPvHB5SUtP4QcZZtSdjkgt_Cxn3oQ3iJ5s,15605
5
5
  oc_cdtapi/DmsGetverAPI.py,sha256=ZPU4HlF59fngKu5mSFhtss3rlBuduffDOSm_y3XWrxk,15556
6
- oc_cdtapi/ForemanAPI.py,sha256=9r1MSOsubiSxM1sdzF2MHD7IcSwX9Y4UDJknHqQK07g,44255
6
+ oc_cdtapi/ForemanAPI.py,sha256=tdD7PXGPeUq7wgwI8D3QkILB-pOICbQCQMyE9BXZhNE,45046
7
7
  oc_cdtapi/JenkinsAPI.py,sha256=lZ8pe3a4eb_6h53JE7QLuzOSlu7Sqatc9PQwWhio9Vg,15748
8
8
  oc_cdtapi/NexusAPI.py,sha256=uU12GtHvKlWorFaPAnFcQ5AGEc94MZ5SdmfM2Pw3F7A,26122
9
9
  oc_cdtapi/PgAPI.py,sha256=URSz7qu-Ir7AOj0jI3ucTXn2PM-nC96nmPZI746OLjA,14356
@@ -12,9 +12,9 @@ oc_cdtapi/RundeckAPI.py,sha256=O3LmcFaHSz8UqeUyIHTTEMJncDD191Utd-iZaeJay2s,24243
12
12
  oc_cdtapi/TestServer.py,sha256=HV97UWg2IK4gOYAp9yaMdwFUWsw9v66MxyZdI3qQctA,2715
13
13
  oc_cdtapi/VaultAPI.py,sha256=P-x_PsWe_S0mGUKTCmR1KhUjdfs7GmyaltjGQcnWj_s,2967
14
14
  oc_cdtapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- oc_cdtapi-3.21.8.data/scripts/nexus.py,sha256=4teqZ_KtCSrwHDJVgA7lkreteod4Xt5XJFZNbwb7E6E,6858
16
- oc_cdtapi-3.21.8.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
17
- oc_cdtapi-3.21.8.dist-info/METADATA,sha256=dZ_OtFV8oU_jNs249Mj4KMEUkAjN2hrPxlkl9wjcD_c,504
18
- oc_cdtapi-3.21.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
- oc_cdtapi-3.21.8.dist-info/top_level.txt,sha256=d4-5-D-0CSeSXYuLCP7-nIFCpjkfmJr-Y_muzds8iVU,10
20
- oc_cdtapi-3.21.8.dist-info/RECORD,,
15
+ oc_cdtapi-3.22.1.data/scripts/nexus.py,sha256=4teqZ_KtCSrwHDJVgA7lkreteod4Xt5XJFZNbwb7E6E,6858
16
+ oc_cdtapi-3.22.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
17
+ oc_cdtapi-3.22.1.dist-info/METADATA,sha256=JbARpF0q8pRtbrbo0NedtjD-21ywiWteCpn8cxeHDt8,504
18
+ oc_cdtapi-3.22.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
+ oc_cdtapi-3.22.1.dist-info/top_level.txt,sha256=d4-5-D-0CSeSXYuLCP7-nIFCpjkfmJr-Y_muzds8iVU,10
20
+ oc_cdtapi-3.22.1.dist-info/RECORD,,