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

Group.get needs to allow parameterized local filenames to avoid overwriting #1868

Open
cooperlees opened this Issue Sep 5, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@cooperlees

cooperlees commented Sep 5, 2018

Hi,

I'd like to be able to .get() on a ThreadingGroup and have the hostname/ip/somethingunique added to the dst filename so I can get the same file from multiple hosts.

Sorry if I missed it, but I can not see a clean way to move to:

ThreadingGroup(*hosts, **DEFAULT_FAB_KWARGS).get(self._src, self._dst)

from

        ...
        with fab.settings(fab.hide("running"), warn_only=True):
            fab.execute(self._get, hosts=hosts)

    @fab.parallel
    def _get(self):
        fab.get(self._src, self._dst + "." + fab.env.host)

Please merge or propose workaround if they exist! Thanks.

@bitprophet

This comment has been minimized.

Show comment
Hide comment
@bitprophet

bitprophet Sep 6, 2018

Member

I'm hoping this is in the upgrade doc because yes, it's a clear missing feature from v1 :)

EDIT: it is not in that doc! I'll add a line item and I think this may be the "TODO" ticket for this particular aspect of the feature so I'll tweak the desc.

Member

bitprophet commented Sep 6, 2018

I'm hoping this is in the upgrade doc because yes, it's a clear missing feature from v1 :)

EDIT: it is not in that doc! I'll add a line item and I think this may be the "TODO" ticket for this particular aspect of the feature so I'll tweak the desc.

@bitprophet bitprophet changed the title from ThreadingGroup + get() with host specific dst filename to Group.get needs to allow parameterized local filenames to avoid overwriting Sep 6, 2018

@bitprophet

This comment has been minimized.

Show comment
Hide comment
@bitprophet

bitprophet Sep 6, 2018

Member

We'll probably want to honor how v1 did this (which I was just in the middle of reinventing myself before I edited this comment...sigh) which is tl;dr an interpolated string config value, handed a bunch of values for parameterization (remote basename and pathname, connection object params, etc).

Main diff would be that we should hand in just a connection key/val by itself instead of manually teasing out useful Connection obj attributes ourselves as individual keys (i.e. no "{host}", but instead, "{connection.host}").

Member

bitprophet commented Sep 6, 2018

We'll probably want to honor how v1 did this (which I was just in the middle of reinventing myself before I edited this comment...sigh) which is tl;dr an interpolated string config value, handed a bunch of values for parameterization (remote basename and pathname, connection object params, etc).

Main diff would be that we should hand in just a connection key/val by itself instead of manually teasing out useful Connection obj attributes ourselves as individual keys (i.e. no "{host}", but instead, "{connection.host}").

@bitprophet bitprophet added this to the p3 milestone Sep 6, 2018

@cooperlees

This comment has been minimized.

Show comment
Hide comment
@cooperlees

cooperlees Sep 6, 2018

Thanks. I checked the document multiple times for this feature and couldn't find it anywhere. Many thanks for acknowledging and updating the PR + docs.

I'm not fussed, long as there is a nice way with the new API to use it I'll be super happy. Also happy to try and help, but prob getting up to speed might take a bit of time.

cooperlees commented Sep 6, 2018

Thanks. I checked the document multiple times for this feature and couldn't find it anywhere. Many thanks for acknowledging and updating the PR + docs.

I'm not fussed, long as there is a nice way with the new API to use it I'll be super happy. Also happy to try and help, but prob getting up to speed might take a bit of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment