Skip to content

Commit

Permalink
timeout parameters added to cli create methods (#14861)
Browse files Browse the repository at this point in the history
  • Loading branch information
pondrejk authored Apr 23, 2024
1 parent 2c5e9a5 commit e8c1ed9
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions robottelo/cli/contentview.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class ContentViewFilterRule(Base):
command_base = 'content-view filter rule'

@classmethod
def create(cls, options=None):
def create(cls, options=None, timeout=None):
"""Create a content-view filter rule"""
if (
not options
Expand All @@ -55,7 +55,7 @@ def create(cls, options=None):
' "content-view-filter" or "content-view-filter-id".'
)
cls.command_sub = 'create'
result = cls.execute(cls._construct_command(options), output_format='csv')
result = cls.execute(cls._construct_command(options), output_format='csv', timeout=timeout)

# Extract new CV filter rule ID if it was successfully created
if len(result) > 0 and 'id' in result[0]:
Expand Down
4 changes: 2 additions & 2 deletions robottelo/cli/host.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,10 +478,10 @@ class HostInterface(Base):
command_base = 'host interface'

@classmethod
def create(cls, options=None):
def create(cls, options=None, timeout=None):
"""Create new network interface for host"""
cls.command_sub = 'create'
cls.execute(cls._construct_command(options), output_format='csv')
cls.execute(cls._construct_command(options), output_format='csv', timeout=timeout)


class HostTraces(Base):
Expand Down
4 changes: 2 additions & 2 deletions robottelo/cli/report_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class ReportTemplate(Base):
command_base = 'report-template'

@classmethod
def create(cls, options=None):
def create(cls, options=None, timeout=None):
"""
Creates a new record using the arguments passed via dictionary.
"""
Expand Down Expand Up @@ -73,7 +73,7 @@ def create(cls, options=None):

options['file'] = layout

result = cls.execute(cls._construct_command(options), output_format='csv')
result = cls.execute(cls._construct_command(options), output_format='csv', timeout=timeout)

# Extract new object ID if it was successfully created
if len(result) > 0 and 'id' in result[0]:
Expand Down
4 changes: 2 additions & 2 deletions robottelo/cli/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ class Repository(Base):
command_requires_org = True

@classmethod
def create(cls, options=None):
def create(cls, options=None, timeout=None):
"""Create a custom repository"""
cls.command_requires_org = False

try:
result = super().create(options)
result = super().create(options, timeout)
finally:
cls.command_requires_org = True

Expand Down
4 changes: 2 additions & 2 deletions robottelo/cli/syncplan.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class SyncPlan(Base):
command_base = 'sync-plan'

@classmethod
def create(cls, options=None):
def create(cls, options=None, timeout=None):
"""Create a SyncPlan"""
cls.command_sub = 'create'

if options.get('interval') == 'custom cron' and options.get('cron-expression') is None:
raise CLIError('Missing "cron-expression" option for "custom cron" interval.')

return super().create(options)
return super().create(options, timeout)
4 changes: 2 additions & 2 deletions robottelo/cli/template_input.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class TemplateInput(Base):
command_base = 'template-input'

@classmethod
def create(cls, options=None):
def create(cls, options=None, timeout=None):
"""
Creates a new record using the arguments passed via dictionary.
"""
Expand All @@ -36,7 +36,7 @@ def create(cls, options=None):
if options is None:
options = {}

result = cls.execute(cls._construct_command(options), output_format='csv')
result = cls.execute(cls._construct_command(options), output_format='csv', timeout=timeout)

# Extract new object ID if it was successfully created
if len(result) > 0 and 'id' in result[0]:
Expand Down
4 changes: 2 additions & 2 deletions robottelo/cli/usergroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,10 @@ def refresh(cls, options=None):
return cls.execute(cls._construct_command(options), output_format='csv')

@classmethod
def create(cls, options=None):
def create(cls, options=None, timeout=None):
"""Create external user group"""
cls.command_sub = 'create'
result = cls.execute(cls._construct_command(options), output_format='csv')
result = cls.execute(cls._construct_command(options), output_format='csv', timeout=timeout)
# External user group can only be fetched by specifying both id and
# user group id it is linked to
if len(result) > 0 and 'id' in result[0]:
Expand Down
4 changes: 2 additions & 2 deletions robottelo/cli/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Webhook(Base):
command_base = 'webhook'

@classmethod
def create(cls, options=None):
def create(cls, options=None, timeout=None):
"""Create a webhook"""
cls.command_sub = 'create'

Expand All @@ -41,4 +41,4 @@ def create(cls, options=None):
'See See "hammer webhook create --help" for the list of supported methods'
)

return super().create(options)
return super().create(options, timeout)

0 comments on commit e8c1ed9

Please sign in to comment.