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

Allow run::bind config to specify different destination #91

Merged

Conversation

matthoosier-garmin
Copy link
Contributor

Until now, the directories mentioned in this config key have always been mounted at the same absolute path in the container as they exist on the host. Extend this to allow a different destination path in the container:

...
[run]
bind =
...
/src-path:/dst-path
...

All of the usual options already recognized are valid for entries specified using this expanded syntax.

Change-Id: Iaa0e70325f576d71ea672da082ce1a76c9c81c94

pyrex.py Outdated
class ParsingError(Exception):
def __init__(self, message):
super().__init__(message)
self.message = message
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary. The message passed to Exception is the default when the exception is printed as a string:

try:
    raise Exception("Hello")
except Exception as e:
    print("%s" % e)
Hello

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably just do:

class ParsingError(Exception):
    pass

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, bad luck on my part. I tested all of this using KeyError as my dummy exception type to carry along the string. I didn't like that it artificially enclosed the string inside single-quotes. Turns out that behavior is specific to KeyError. You're right that str(Exception('Hello')) does act the way I'd want.

Thanks. I'll update it.

@matthoosier-garmin matthoosier-garmin force-pushed the specify-bind-mount-destination branch 2 times, most recently from 6178ff5 to 2c35e46 Compare July 24, 2024 21:46
Until now, the directories mentioned in this config key have always been
mounted at the same absolute path in the container as they exist on the
host. Extend this to allow a different destination path in the container:

  ...
  [run]
  bind =
    ...
    /src-path:/dst-path
    ...

All of the usual options already recognized are valid for entries
specified using this expanded syntax.

Change-Id: Iaa0e70325f576d71ea672da082ce1a76c9c81c94
@JoshuaWatt JoshuaWatt merged commit c617275 into garmin:master Jul 25, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants