Skip to content
New issue

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

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

Already on GitHub? # to your account

Usability issue on launchpad username when using "lp:" as prefix #178

Open
locnnil opened this issue Dec 15, 2023 · 1 comment
Open

Usability issue on launchpad username when using "lp:" as prefix #178

locnnil opened this issue Dec 15, 2023 · 1 comment

Comments

@locnnil
Copy link

locnnil commented Dec 15, 2023

Main problem:

The way the prefix lp: is written tends to lead the user to think that it's okay to put a space between the prefix and the Launchpad username.

Because, the usage of : as part of the prefix tends to make one assume that it's another key-value parameter. If some other character were used, like lp/locnnil, this confusion wouldn't happen.

This is the error that occurs when you put a space on the ssh_keys value like: lp: locnnil

2023-12-15 18:45:25,270 sru20210629207 INFO: DEVICE AGENT: BEGIN reservation
Traceback (most recent call last):
  File "/srv/testflinger-agent/sru20210629207/env/bin/snappy-device-agent", line 8, in <module>
    sys.exit(main())
  File "/srv/testflinger-agent/sru20210629207/env/lib/python3.8/site-packages/snappy_device_agents/cmd.py", line 59, in main
    raise SystemExit(args.func(args))
  File "/srv/testflinger-agent/sru20210629207/env/lib/python3.8/site-packages/snappy_device_agents/devices/__init__.py", line 172, in reserve
    proc = subprocess.run(cmd)
  File "/usr/lib/python3.8/subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1639, in _execute_child
    self.pid = _posixsubprocess.fork_exec(
TypeError: expected str, bytes or os.PathLike object, not dict

So, this problem wouldn't happen if, for example, instead of using : as a separator, the / character could be used. It could be configured like this:

job_queue: 202106-29207
provision_data:
  distro: jammy
reserve_data:
  ssh_keys:
    - lp/locnnil
  timeout: 21600 # 6 hours

Alternatively, an error could also be provided on the client side if the person specifies the lp username with a space after the :.

Copy link

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CERTTF-272.

This message was autogenerated

@locnnil locnnil changed the title Problem on parsing launchpad username from .yaml file Usability issue on launchpad username when using "lp:" as prefix Dec 16, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant