Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

ship config.yml to /usr/share and copy to user home ~/.calyptos #4

Merged
merged 2 commits into from
Jun 9, 2015
Merged

ship config.yml to /usr/share and copy to user home ~/.calyptos #4

merged 2 commits into from
Jun 9, 2015

Conversation

mbacchi
Copy link
Member

@mbacchi mbacchi commented Jun 1, 2015

This changes how we use the config.yml. Instead of placing in /etc
we will put it in /usr/share/calyptos/etc on install, then copy to
~/.calyptos in the user home dir when calyptos is executed.

@viglesiasce please also let me know if you prefer another way to call locate_cfgfile(), I'm not sure how these bootstrap type things are done in Python typically. Without a class to run an init() method I just stuck that method in main.

This changes how we use the config.yml. Instead of placing in /etc
we will put it in /usr/share/calyptos/etc on install, then copy to
~/.calyptos in the user home dir when calyptos is executed.
import shutil

dot_dir = os.path.expanduser('~/.calyptos')
default_cfgfile = os.path.join(dot_dir + "/" + "config.yml")
Copy link
Collaborator

Choose a reason for hiding this comment

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

when using os.path.join its intended to be used as follows:

default_cfgfile = os.path.join(dot_dir, "config.yml")

Its functionality is to join add those /'s for you intelligently (ie removing duplicate /'s and such)

incorporate other PR comments from Vic:
1. use os.path.join properly
2. put config.yml in /usr/share/calyptos

this also copies config.yml to the ~/.calyptos directory
if there IS NOT a calyptos RPM package installed. this
indicates that the user has used setup.py to install as
opposed to rpm/yum, and we are allowing for the possibility
that in a dev environment they may want to edit the config.
@mbacchi
Copy link
Member Author

mbacchi commented Jun 3, 2015

@viglesiasce I added your suggestions, they are in commit:

mbacchi@c878e0e

Let me know what you think

@viglesiasce
Copy link
Collaborator

Thanks @mbacchi !!!

viglesiasce added a commit that referenced this pull request Jun 9, 2015
ship config.yml to /usr/share and copy to user home ~/.calyptos
@viglesiasce viglesiasce merged commit 6cdc3d5 into eucalyptus:master Jun 9, 2015
@mbacchi mbacchi deleted the pkg_config branch July 25, 2015 22:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants