Skip to content

Commit b136048

Browse files
authored
Merge pull request #304 from myakove/fix-print-yaml-on-delete
call to_dict if body is not dict type
2 parents 73929e2 + f075dc7 commit b136048

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ocp_resources/resource.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,8 @@ def create(self, body=None, wait=False):
650650
def delete(self, wait=False, timeout=TIMEOUT_4MINUTES, body=None):
651651
LOGGER.info(f"Delete {self.kind} {self.name}")
652652
if body:
653-
LOGGER.debug(f"\n{yaml.dump(body)}")
653+
_body = body if isinstance(body, dict) else body.to_dict()
654+
LOGGER.debug(f"\n{yaml.dump(_body)}")
654655

655656
try:
656657
res = self.api.delete(name=self.name, namespace=self.namespace, body=body)

0 commit comments

Comments
 (0)