pyghmi 1.6.4__py3-none-any.whl → 1.6.5__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.
pyghmi/redfish/command.py CHANGED
@@ -445,7 +445,7 @@ class Command(object):
445
445
  return self.oem.get_ikvm_launchdata()
446
446
 
447
447
  def user_delete(self, uid):
448
- self.oem.user_delete(uid)
448
+ self.oem.user_delete(uid, self)
449
449
 
450
450
  def set_user_name(self, uid, name):
451
451
  """Set user name
@@ -383,13 +383,19 @@ class OEMHandler(object):
383
383
  summary['badreadings'].append(unkinf)
384
384
  return summary
385
385
 
386
- def user_delete(self, uid):
386
+ def user_delete(self, uid, fishclient):
387
387
  # Redfish doesn't do so well with Deleting users either...
388
388
  # Blanking the username seems to be the convention
389
389
  # First, set a bogus password in case the implementation does honor
390
390
  # blank user, at least render such an account harmless
391
- self.set_user_password(uid, base64.b64encode(os.urandom(15)))
392
- self.set_user_name(uid, '')
391
+ try:
392
+ accinfo = fishclient._account_url_info_by_id(uid)
393
+ if not accinfo:
394
+ raise Exception("No such account found")
395
+ self._do_web_request(accinfo[0], method='DELETE')
396
+ except Exception: # fall back to old ipmi-like behavior for such implementations
397
+ fishclient.set_user_password(uid, base64.b64encode(os.urandom(15)))
398
+ fishclient.set_user_name(uid, '')
393
399
  return True
394
400
 
395
401
  def set_bootdev(self, bootdev, persist=False, uefiboot=None,
@@ -1662,7 +1662,7 @@ class OEMHandler(generic.OEMHandler):
1662
1662
  license_errors[rsp['return']])
1663
1663
  return self.get_licenses(fishclient)
1664
1664
 
1665
- def user_delete(self, uid):
1665
+ def user_delete(self, uid, fishclient=None):
1666
1666
  userinfo = self.wc.grab_json_response('/api/dataset/imm_users')
1667
1667
  uidtonamemap = {}
1668
1668
  for user in userinfo.get('items', [{'users': []}])[0].get('users', []):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyghmi
3
- Version: 1.6.4
3
+ Version: 1.6.5
4
4
  Summary: Python General Hardware Management Initiative (IPMI and others)
5
5
  Home-page: http://github.com/openstack/pyghmi/
6
6
  Author: Jarrod Johnson
@@ -43,9 +43,9 @@ pyghmi/ipmi/private/simplesession.py,sha256=cNGaoT0uWIKDut6gUG9kAOX_b_qTzdB26R6I
43
43
  pyghmi/ipmi/private/spd.py,sha256=oEPSXm19X2eNXDiyW_6fVjBFqhuuMAtBI9quRJgclH4,27094
44
44
  pyghmi/ipmi/private/util.py,sha256=ayYodiSydlrrt0_pQppoRB1T6n-KNOiHZSfAlCMcpG0,3847
45
45
  pyghmi/redfish/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
46
- pyghmi/redfish/command.py,sha256=_HLICBri_ON1GqSqqPNWoNKnGz7YBrqHo_l6tjGRiDc,61350
46
+ pyghmi/redfish/command.py,sha256=XoXSNgnYEanPFGaf6VPdLbGk6EIeep1eK3ouDDG0Nl0,61356
47
47
  pyghmi/redfish/oem/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
- pyghmi/redfish/oem/generic.py,sha256=fX6ADqGURX9cQr-Q8cyncQtxLM1oz5CMv57IQ8ijxoY,57313
48
+ pyghmi/redfish/oem/generic.py,sha256=KPivHBUL_eliAT4xI8fLgS7LbF-1mH_BpkMKFRoN1Fo,57656
49
49
  pyghmi/redfish/oem/lookup.py,sha256=pfJW5xSkUY61OirMeYy0b1SbjBFz6IDfN5ZOYog_Yq4,1530
50
50
  pyghmi/redfish/oem/dell/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
51
51
  pyghmi/redfish/oem/dell/idrac.py,sha256=pNnmqdV1sOP3ABw0xq0wF1QEO2L8onT7Osc_-sDO8EU,2146
@@ -54,7 +54,7 @@ pyghmi/redfish/oem/lenovo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJW
54
54
  pyghmi/redfish/oem/lenovo/main.py,sha256=bnx8LuC_C4_OluNR8JSHIxtSlM4_jdBb4cUzJM6mazE,2597
55
55
  pyghmi/redfish/oem/lenovo/smm3.py,sha256=QHasf5QofFuYqtHPeqcwCEJUbd0PV5_C6u-Y8FVdqCk,7598
56
56
  pyghmi/redfish/oem/lenovo/tsma.py,sha256=6GELCuriumARj_kv7fgqtUpo9ekiWHpQcM9v_mnGILI,34645
57
- pyghmi/redfish/oem/lenovo/xcc.py,sha256=78ksNj2-0jquj61lmAZldy3DdcR5KndqbLQ2Y4ZSFOM,84234
57
+ pyghmi/redfish/oem/lenovo/xcc.py,sha256=ydUn4mwyHcgWKmoDY66O_EVuUo43-Oy7JU8Y_6Km4kA,84251
58
58
  pyghmi/redfish/oem/lenovo/xcc3.py,sha256=8LxWzqXCkNmQ9PT-bu2ZSvgziTar3u1J37x8IRBshx8,55843
59
59
  pyghmi/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
60
60
  pyghmi/tests/unit/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -64,11 +64,11 @@ pyghmi/tests/unit/ipmi/test_sdr.py,sha256=vb3iLY0cnHJ2K_m4xgYUjEcbPd_ZYhYx-uBowB
64
64
  pyghmi/util/__init__.py,sha256=GZLBWJiun2Plb_VE9dDSh4_PQMCha3gA7QLUqx3oSYI,25
65
65
  pyghmi/util/parse.py,sha256=6VlyBCEcE8gy8PJWmEDdtCyWATaKwPaTswCdioPCWOE,2120
66
66
  pyghmi/util/webclient.py,sha256=i1rJ7NBlPQFTRv7kgzbTaOHsWuPeXcMAjRXm_i8CI0A,15652
67
- pyghmi-1.6.4.dist-info/AUTHORS,sha256=yv4aQom_PII-SNqbeeKrfH-spcG85PRPsZ71Iqjl_fU,2083
68
- pyghmi-1.6.4.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
69
- pyghmi-1.6.4.dist-info/METADATA,sha256=iunjBkI12heq3smej-gMbCPO3KdWK4Y60I6yuxqmwd0,1136
70
- pyghmi-1.6.4.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
71
- pyghmi-1.6.4.dist-info/entry_points.txt,sha256=-OpJliDzATxmuPXK0VR3Ma-Yk_i4ZhfIIB-12A26dSI,168
72
- pyghmi-1.6.4.dist-info/pbr.json,sha256=G84aunNCSzzeuUMkVxkxXAfI8E9qATe2tf_kPWkiFWs,46
73
- pyghmi-1.6.4.dist-info/top_level.txt,sha256=aDtt6S9eVu6-tNdaUs4Pz9PbdUd69bziZZMhNvk9Ulc,7
74
- pyghmi-1.6.4.dist-info/RECORD,,
67
+ pyghmi-1.6.5.dist-info/AUTHORS,sha256=yv4aQom_PII-SNqbeeKrfH-spcG85PRPsZ71Iqjl_fU,2083
68
+ pyghmi-1.6.5.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
69
+ pyghmi-1.6.5.dist-info/METADATA,sha256=NwQSpwKaIXyG_7u6DZLjy06x0Xkcao9oV8XcGLNT6HM,1136
70
+ pyghmi-1.6.5.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
71
+ pyghmi-1.6.5.dist-info/entry_points.txt,sha256=-OpJliDzATxmuPXK0VR3Ma-Yk_i4ZhfIIB-12A26dSI,168
72
+ pyghmi-1.6.5.dist-info/pbr.json,sha256=r8aaroFMObDxmIIa6_e_w9lYyPvv1WHskqCleNGcnY0,46
73
+ pyghmi-1.6.5.dist-info/top_level.txt,sha256=aDtt6S9eVu6-tNdaUs4Pz9PbdUd69bziZZMhNvk9Ulc,7
74
+ pyghmi-1.6.5.dist-info/RECORD,,
@@ -0,0 +1 @@
1
+ {"git_version": "f56e000", "is_release": true}
@@ -1 +0,0 @@
1
- {"git_version": "99af22b", "is_release": true}
File without changes