-
-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Start of migration framework, to allow moving of files in the config … #7740
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
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -36,6 +36,10 @@ | |
| CONFIG_DIR_NAME = '.homeassistant' | ||
| DATA_CUSTOMIZE = 'hass_customize' | ||
|
|
||
| FILE_MIGRATION = [ | ||
| ["ios.conf", ".ios.conf"], | ||
| ] | ||
|
|
||
| DEFAULT_CORE_CONFIG = ( | ||
| # Tuples (attribute, default, auto detect property, description) | ||
| (CONF_NAME, 'Home', None, 'Name of the location where Home Assistant is ' | ||
|
|
@@ -292,6 +296,12 @@ def process_ha_config_upgrade(hass): | |
| with open(version_path, 'wt') as outp: | ||
| outp.write(__version__) | ||
|
|
||
| _LOGGER.info('Migrating old system config files to new locations') | ||
| for mfile in FILE_MIGRATION: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| if os.path.isfile(hass.config.path(mfile[0])): | ||
| _LOGGER.info('Migrating %s to %s', mfile[0], mfile[1]) | ||
| os.rename(hass.config.path(mfile[0]), hass.config.path(mfile[1])) | ||
|
|
||
|
|
||
| @callback | ||
| def async_log_exception(ex, domain, config, hass): | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,7 +2,7 @@ | |
| """Constants used by Home Assistant components.""" | ||
| MAJOR_VERSION = 0 | ||
| MINOR_VERSION = 46 | ||
| PATCH_VERSION = '0.dev0' | ||
| PATCH_VERSION = '0.dev1' | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Change was done so that people running dev would also get the update. Otherwise we would break anyone running dev. This prevents thats. |
||
| __short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) | ||
| __version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) | ||
| REQUIRED_PYTHON_VER = (3, 4, 2) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be a dict instead? Just fewer brackets.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may change this in the future, more a fan of an array, since logically to me its not really a key value pair, but a list of tuples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.