[Bugs] [Bug 1707731] [Upgrade] Config files are not upgraded to new version
bugzilla at redhat.com
bugzilla at redhat.com
Fri May 17 06:53:49 UTC 2019
https://bugzilla.redhat.com/show_bug.cgi?id=1707731
Aravinda VK <avishwan at redhat.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Assignee|avishwan at redhat.com |sacharya at redhat.com
--- Comment #1 from Aravinda VK <avishwan at redhat.com> ---
## Reading Old format:
Config file consists of a section named "__section_order__", read that to get
the order of different section. Sort the section based on order(based on
values), and prepare a dict with values updated from each section.
For example:
```
[__section_order__]
sec1=0
sec2=2
sec3=1
[sec1]
log_level = INFO
[sec2]
log_level = DEBUG
[sec3]
log_level = ERROR
```
configs = {}
for sec in sorded_sections():
for item_key, item_value in sec.items:
configs[item_key] = item_value
With this logic, `log_level` will have final value "DEBUG"
## Upgrade:
During Geo-rep start(In gsyncd.py):
- Read the session config and see it is a new format or old
- If it is old format, read the config as explained above
- Compare the configs collected and write to new config only if it is different
from Default configs
- Reload the new config
To get the old format config,
- Install old version of Glusterfs(<4) and create a geo-rep session.
- Set some configurations in Geo-rep
- Copy the config file for reference
- Old parsing code can be referred here
https://github.com/gluster/glusterfs/blob/release-3.13/geo-replication/syncdaemon/configinterface.py
--
You are receiving this mail because:
You are on the CC list for the bug.
More information about the Bugs
mailing list