Skip to content

Commit

Permalink
Add arch feature to tmt try
Browse files Browse the repository at this point in the history
  • Loading branch information
Ismail Ibrahim Quwarah committed Oct 30, 2024
1 parent 1537bb7 commit f89006a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tmt/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1762,12 +1762,15 @@ def init(
@option(
"--install", default=[], metavar="PACKAGE", multiple=True,
help="Install package on the guest.")
@option(
"--arch", default="", metavar="ARCH", multiple=False,
help="Specify guest CPU architecture.")
@option(
"-a", "--ask", is_flag=True, default=False,
help="Just provision the guest and ask what to do next.")
@verbosity_options
@force_dry_options
def try_command(context: Context, image_and_how: str, **kwargs: Any) -> None:
def try_command(context: Context, image_and_how: str, arch: str, **kwargs: Any) -> None:
"""
Try tests or experiment with guests.
Expand Down Expand Up @@ -1808,6 +1811,10 @@ def try_command(context: Context, image_and_how: str, **kwargs: Any) -> None:
else:
options = {"image": image_and_how}

# Add guest architecture if provided
if arch:
options['arch'] = arch

# For 'connect' rename 'image' to 'guest'
if options.get('how') == 'connect':
options['guest'] = options.pop('image')
Expand Down

0 comments on commit f89006a

Please sign in to comment.