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

LocalManager has a hard-coded reference to "~/.pcocc" instead of using PCOCC_USER_CONF_DIR #10

Open
ypsah opened this issue Apr 4, 2019 · 0 comments

Comments

@ypsah
Copy link

ypsah commented Apr 4, 2019

It could be when we start migrating to the XDG Base Directory Specification. 😉
Unless this is not a bug, files are not ending up in the right directory anyway.

I think XDG_CACHE_HOME could be the right path to use:

def xdg_cache_home():
    try:
        return os.environ['XDG_CACHE_HOME']
    except KeyError:
        return os.path.join(os.environ['HOME'], '.cache')

class LocalManager(EtcdManager):
    def __init__(self, batchid, batchname, default_batchname, settings,
                 proc_type, batchuser):
        (...)
        self.pcocc_state_dir = os.path.join(xdg_cache_home(), 'pcocc',
                                            something)
        (...)
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

No branches or pull requests

1 participant