Skip to content

Commit

Permalink
* [apiclient] fix KeyError when removing empty key (#1437)
Browse files Browse the repository at this point in the history
  • Loading branch information
lanfon72 authored Aug 20, 2024
1 parent e1a7ba8 commit ca2f130
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion apiclient/harvester_api/managers/virtualmachines.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def get_status(self, name="", namespace=DEFAULT_NAMESPACE, *, raw=False, **kwarg
def create(self, name, vm_spec, namespace=DEFAULT_NAMESPACE, *, raw=False):
if isinstance(vm_spec, self.Spec):
vm_spec = self.Spec.to_dict(vm_spec, name, namespace)
vm_spec['metadata'].pop('resourceVersion') # remove for create new ones
vm_spec['metadata'].pop('resourceVersion', None) # remove for create new ones
path = self.PATH_fmt.format(uid="", ns=namespace)
return self._create(path, json=vm_spec, raw=raw)

Expand Down

0 comments on commit ca2f130

Please sign in to comment.