Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing cli_factory #17587

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions robottelo/host_helpers/cli_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
from robottelo.config import settings
from robottelo.exceptions import CLIFactoryError, CLIReturnCodeError
from robottelo.host_helpers.repository_mixins import initiate_repo_helpers
from robottelo.logging import logger
from robottelo.utils.manifest import clone


Expand All @@ -49,6 +50,8 @@ def create_object(cli_object, options, values=None, credentials=None, timeout=No
:return: A dictionary representing the newly created resource.

"""
logger.debug(f'!!!HERE OPTIONS!!!!\n {options}')
logger.debug(f'!!!HERE VALUES!!!!\n {values}')
options.update(values or {})
if credentials:
cli_object = cli_object.with_user(*credentials)
Expand All @@ -62,6 +65,13 @@ def create_object(cli_object, options, values=None, credentials=None, timeout=No
# Sometimes we get a list with a dictionary and not a dictionary.
if isinstance(result, list) and len(result) > 0:
result = result[0]
logger.debug(
f'!!!HERE PRE-BOX!!!!\n Created {cli_object.__name__} with data:\n{pprint.pformat(result, indent=2)}'
)
logger.debug(
f'!!!HERE POST-BOX!!!!\n Created {cli_object.__name__} with data:\n{pprint.pformat(Box(result), indent=2)}'
)

return Box(result)


Expand Down
Loading