Bug 967129

Summary: add support for inline comments
Product: [Fedora] Fedora Reporter: Jaroslav Henner <jhenner>
Component: crudiniAssignee: Alan Pevec <apevec>
Status: ASSIGNED --- QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: agk, akanshasharma1593, anjlikhan273, apevec, awdeshkumar5546, banggirl232, bawoc98708, bhaidk0309451, bond123james12, brightfulprojecthk, camig85807, chamankumar6695, cvecarafragola, delhiescorts711, dmoz.rs, eglynn, Eradr9823, freightprojecthk, frishayca, hariom44500, hgczcer770, hussainnazakat602, itsnatashaarora, itsrashikhanna19, itssaniyasharma55, ivarhanks, jogedib945, jwakely, kamaleshkhan870, Kaushal.trr, khurmisaab11, kolikammaagarawalpunecg, kolkatanights778, m79655377, markmc, meena09122jj, meena76bf, monaj334kmr, nandiniaryaji156, Rahulsharma98232, reshmaroy876, santayajuparjapari6574, sgordon, simplegreatjobhk, simransingh6950, sonam.sharmaes, thapkirahut543, vijaymehta6584, wwee7940, yamimalhotra654321
Target Milestone: ---Keywords: FutureFeature, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jaroslav Henner 2013-05-24 20:41:11 UTC
Description of problem:
$subj

Version-Release number of selected component (if applicable):
openstack-keystone-2013.1.1-1.el6ost.noarch

How reproducible:
3/3

Steps to Reproduce:
1. openstack-config --set /etc/keystone/keystone.conf DEFAULT compute_port "3000 # Evil"
$ /etc/init.d/openstack-keystone restart
Stopping keystone:                                         [FAILED]
Starting keystone:                                         [  OK  ]
$ /etc/init.d/openstack-keystone status
keystone dead but pid file exists

Actual results:
service do not start, nothing in log

Expected results:
service started or error in log

Additional info:

Comment 1 Pádraig Brady 2013-09-03 00:17:36 UTC
The standard python ini parsing libs support inline comments,
but only with ; as the comment delimeter. It seems the standard
windows ini parse doesn't even allow that.
Looking at the example.ini from the crudini project we see

 comment_after1=val ;a comment
 comment_after2=val;not a comment
 comment_after3=val #not a comment

The # is not usable in an inline comment for "backwards compat" reasons according to the python docs. So I would say the particular use case is catered for here by:

 openstack-config --set /etc/keystone/keystone.conf DEFAULT compute_port "3000 ;Evil"

But having a quick look at the code suggests that even ; isn't supported unless at the start of the line, since: https://review.openstack.org/#/c/5375/
It's a pity the existing stdlib parser couldn't be extended somehow to
support MultiStrOpt.

Another option is to add the --comment option to openstack-config (or more likely crudini), that would add the associated option on an adjacent line.

Comment 2 Pádraig Brady 2015-02-03 12:32:38 UTC
The hack to set the comment as part of the --set value is not good,
because that would repeat comments for existing values.
I'm not sure it's appropriate at this stage to change the config file format upstream to support inline comments, given how non standard this is
anyway as noted in comment #1

The best option woule be to abstract the file representation,
using a --comment option in crudini, which would update comments,
probably on a separate line.

Comment 4 Shellyowell 2020-09-25 07:39:43 UTC Comment hidden (spam)
Comment 5 Karaardy 2020-11-04 16:50:01 UTC Comment hidden (spam)
Comment 6 Renee Phelps 2020-11-14 05:37:06 UTC Comment hidden (spam)
Comment 7 yami malhotra 2021-01-07 05:44:26 UTC Comment hidden (spam)
Comment 8 Yash 2021-05-17 18:22:46 UTC Comment hidden (spam)
Comment 9 SONAMSHARMA69 2021-09-15 06:36:54 UTC Comment hidden (spam)
Comment 10 Akansha Sharma 2022-04-01 06:16:40 UTC Comment hidden (spam)
Comment 11 Akansha Sharma 2022-04-01 06:17:44 UTC Comment hidden (spam)
Comment 12 ivarhanks 2022-08-01 09:23:22 UTC Comment hidden (spam)
Comment 13 ivarhanks 2022-08-01 09:25:07 UTC Comment hidden (spam)
Comment 14 ivarhanks 2022-08-01 09:26:15 UTC Comment hidden (spam)
Comment 15 ivarhanks 2022-08-01 09:27:15 UTC Comment hidden (spam)
Comment 16 ivarhanks 2022-08-01 11:03:25 UTC Comment hidden (spam)
Comment 17 ivarhanks 2022-08-01 11:05:44 UTC Comment hidden (spam)
Comment 18 ivarhanks 2022-08-01 11:07:06 UTC Comment hidden (spam)
Comment 19 ivarhanks 2022-08-01 11:07:51 UTC Comment hidden (spam)
Comment 20 ivarhanks 2022-08-01 11:09:10 UTC Comment hidden (spam)
Comment 21 ivarhanks 2022-08-01 11:10:08 UTC Comment hidden (spam)
Comment 22 ivarhanks 2022-08-01 11:22:24 UTC Comment hidden (spam)
Comment 23 ivarhanks 2022-08-01 11:23:59 UTC Comment hidden (spam)
Comment 24 ivarhanks 2022-08-01 11:25:03 UTC Comment hidden (spam)
Comment 25 ivarhanks 2022-08-01 11:27:11 UTC Comment hidden (spam)
Comment 26 ivarhanks 2022-08-01 11:28:07 UTC Comment hidden (spam)
Comment 28 natashaarora 2022-09-05 07:33:35 UTC Comment hidden (spam)
Comment 29 Kolkata Escorts 2022-09-21 06:13:37 UTC Comment hidden (spam)
Comment 30 Junaid 2022-10-21 12:33:43 UTC Comment hidden (spam)
Comment 31 rashikhanna 2022-11-02 10:09:02 UTC Comment hidden (spam)
Comment 32 reshmaroy 2022-12-21 05:12:49 UTC Comment hidden (spam)
Comment 33 reshmaroy 2022-12-21 05:17:10 UTC Comment hidden (spam)
Comment 34 reshmaroy 2022-12-21 05:17:10 UTC Comment hidden (spam)
Comment 35 reshmaroy 2022-12-21 05:18:33 UTC Comment hidden (spam)
Comment 36 reshmaroy 2022-12-21 05:18:44 UTC Comment hidden (spam)
Comment 37 reshmaroy 2022-12-21 05:18:44 UTC Comment hidden (spam)
Comment 39 Fedora Admin user for bugzilla script actions 2023-01-10 12:11:36 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 40 Fedora Admin user for bugzilla script actions 2023-01-18 12:06:13 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 41 kolkata dolls 2023-01-19 09:12:25 UTC Comment hidden (spam)
Comment 42 Jaipur Dolls 2023-01-23 06:52:23 UTC Comment hidden (spam)
Comment 43 richapanday 2023-01-31 13:09:24 UTC Comment hidden (spam)
Comment 44 bangaloredolls 2023-02-01 05:18:13 UTC Comment hidden (spam)
Comment 45 nanditaagarawal 2023-02-01 06:20:42 UTC Comment hidden (spam)
Comment 46 heavenmumbai 2023-02-10 07:12:40 UTC Comment hidden (spam)
Comment 47 heavenmumbai 2023-02-10 07:15:20 UTC Comment hidden (spam)
Comment 48 heavenmumbai 2023-02-10 07:16:00 UTC Comment hidden (spam)
Comment 49 heavenmumbai 2023-02-10 07:16:16 UTC Comment hidden (spam)
Comment 50 thapkirahut543@gmail.com 2023-02-10 11:35:41 UTC Comment hidden (spam)
Comment 51 thapkirahut543@gmail.com 2023-02-10 11:36:38 UTC Comment hidden (spam)
Comment 52 thapkirahut543@gmail.com 2023-02-10 11:37:22 UTC Comment hidden (spam)
Comment 53 thapkirahut543@gmail.com 2023-02-10 11:37:59 UTC Comment hidden (spam)
Comment 55 vijaymehta6584@gmail.com 2023-02-16 08:48:07 UTC Comment hidden (spam)
Comment 56 vijaymehta6584@gmail.com 2023-02-16 08:48:30 UTC Comment hidden (spam)
Comment 57 vijaymehta6584@gmail.com 2023-02-16 08:48:59 UTC Comment hidden (spam)
Comment 59 Dipika Panday 2023-03-03 02:31:33 UTC Comment hidden (spam)
Comment 60 dollybansal 2023-03-03 09:14:16 UTC Comment hidden (spam)
Comment 61 dollybansal 2023-03-03 09:16:42 UTC Comment hidden (spam)
Comment 62 hotishadubeys 2023-03-06 06:41:16 UTC Comment hidden (spam)
Comment 64 Sneha Mittal 2023-03-09 06:42:02 UTC Comment hidden (spam)
Comment 65 paridubey 2023-03-14 10:35:44 UTC Comment hidden (spam)
Comment 66 https://plaza.rakuten.co.jp/zauca/diary/202303170000/ 2023-03-17 06:59:34 UTC Comment hidden (spam)
Comment 67 frishay 2023-03-20 11:58:58 UTC Comment hidden (spam)
Comment 68 punedolls 2023-04-04 07:43:39 UTC Comment hidden (spam)
Comment 75 Lord Abass 2023-06-15 20:57:10 UTC Comment hidden (spam)
Comment 76 dollybansal 2023-06-16 05:51:54 UTC Comment hidden (spam)
Comment 79 Anjali Khan 2023-07-19 19:03:04 UTC Comment hidden (spam)
Comment 80 topescortservice 2023-08-03 06:26:55 UTC Comment hidden (spam)
Comment 82 kleinanzeigen 2023-12-23 16:37:56 UTC Comment hidden (spam)
Comment 84 simplejob 2024-01-01 08:05:12 UTC Comment hidden (spam)
Comment 85 brightful Project 2024-02-26 03:52:34 UTC Comment hidden (spam)
Comment 86 Freight Project 2024-03-28 02:35:49 UTC Comment hidden (spam)
Comment 87 Freight Project 2024-03-28 02:36:24 UTC Comment hidden (spam)