Reviewed: https://review.openstack.org/368231 Committed: https://git.openstack.org/cgit/openstack/glance/commit/?id=9968b0993fe1859b7accb6701f2fffcbed757bc0 Submitter: Jenkins Branch: master
commit 9968b0993fe1859b7accb6701f2fffcbed757bc0 Author: Alexander Bashmakov <[email protected]> Date: Fri Sep 9 13:44:36 2016 -0700 Added overwrite warning for db_export_metadefs. The bug in [1] proposed to always require a directory option for glance-manage db_export_metadefs command. The rationale being that silently overwriting the default path /etc/glance/metadefs can be undesired. However, the feedback was that this command should stay silent in case it's called from cron jobs or automated tasks, and that it's better to simply log a warning and proceed, as well as update the documentation with a cautionary note. This patch addresses that request. [1] https://bugs.launchpad.net/glance/+bug/1367011 Change-Id: Ie8cc4bb3769a6347fd25e2235a72c6358af70d42 Closes-Bug: #1367011 ** Changed in: glance Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to Glance. https://bugs.launchpad.net/bugs/1367011 Title: glance-manage db_export_metadefs should always require a directory option Status in Glance: Fix Released Bug description: Currently if you call glance-manage db_export_metadefs without any additional options, it will export all current metadefs into the glance conf dir (e.g. /etc/glance/metadefs/) without any warning. If the files already exist it will overwrite them. This is a potentially very dangerous operation that would delete all the existing files in that directory without warning and with no way of getting them back. A new user may just call it hoping to see the parameters and instead end up having all their files overwritten whether they want to or not. I think that db_export_metadefs should always require a parameter of the output directory to save them to. Either that or export them to a safer location by default. Would like additional input from Glance team on this one. Example: $ glance-manage db_export_metadefs 2014-09-08 16:11:15.865 5029 DEBUG oslo.db.sqlalchemy.session [-] MySQL server mode set to STRICT_TRANS_TABLES,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,TRADITIONAL,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION _init_events /usr/local/lib/python2.7/dist- packages/oslo/db/sqlalchemy/session.py:461 2014-09-08 16:11:15.900 5029 INFO glance.db.sqlalchemy.metadata [-] Namespace RandomNumberGenerator saved in /etc/glance/metadefs/RandomNumberGenerator.json 2014-09-08 16:11:15.910 5029 INFO glance.db.sqlalchemy.metadata [-] Namespace VirtualCPUTopology saved in /etc/glance/metadefs/VirtualCPUTopology.json etc... To manage notifications about this bug go to: https://bugs.launchpad.net/glance/+bug/1367011/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

