Bug 967129 - add support for inline comments
Summary: add support for inline comments
Keywords:
Status: ASSIGNED
Alias: None
Product: Fedora
Classification: Fedora
Component: crudini
Version: rawhide
Hardware: Unspecified
OS: Linux
low
medium
Target Milestone: ---
Assignee: Pádraig Brady
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-05-24 20:41 UTC by Jaroslav Henner
Modified: 2026-02-16 10:31 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

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)
Comment 88 SM Taha 2024-05-09 13:47:29 UTC Comment hidden (spam)
Comment 89 Cityuvb 2024-06-01 02:08:25 UTC Comment hidden (spam)
Comment 91 Fedora Admin user for bugzilla script actions 2024-06-25 12:44:57 UTC
This package has changed maintainer in Fedora. Reassigning to the new maintainer of this component.

Comment 92 no_no_no 2024-07-15 19:12:53 UTC Comment hidden (spam)
Comment 93 commrz 2024-07-20 08:48:47 UTC Comment hidden (spam)
Comment 94 Supriti 2024-08-21 10:50:12 UTC Comment hidden (spam)
Comment 95 NatashaRoy 2024-11-26 14:18:45 UTC Comment hidden (spam)
Comment 96 Varsha Chauhan 2024-12-05 14:05:33 UTC Comment hidden (spam)
Comment 97 prasadsweety171 2024-12-13 15:24:35 UTC Comment hidden (spam)
Comment 98 prasadsweety171 2024-12-13 15:25:38 UTC Comment hidden (spam)
Comment 99 Sahara Desert Kingdom 2025-01-27 15:20:35 UTC Comment hidden (spam)
Comment 100 Sahara Desert Kingdom 2025-01-27 15:20:55 UTC Comment hidden (spam)
Comment 101 andabuilding 2025-04-04 04:25:30 UTC Comment hidden (spam)
Comment 102 Liam Carter 2025-05-11 12:13:24 UTC Comment hidden (spam)
Comment 103 ViralChilly 2025-06-03 09:32:55 UTC Comment hidden (spam)
Comment 104 skokaarcggirls 2025-06-11 10:51:58 UTC Comment hidden (spam)
Comment 105 Anand Chauhan 2025-09-08 08:24:06 UTC Comment hidden (spam)
Comment 106 fedonaf561@poesd.com 2025-09-13 07:25:01 UTC Comment hidden (spam)
Comment 107 cowigal 2025-09-13 08:28:37 UTC Comment hidden (spam)
Comment 108 cowigal 2025-09-13 08:31:57 UTC Comment hidden (spam)
Comment 109 rajor22913@ishense.com 2025-09-13 08:42:05 UTC Comment hidden (spam)
Comment 110 rajor22913@ishense.com 2025-09-13 08:43:11 UTC Comment hidden (spam)
Comment 111 rajor22913@ishense.com 2025-09-13 09:03:15 UTC Comment hidden (spam)
Comment 112 rajor22913@ishense.com 2025-09-13 09:06:54 UTC Comment hidden (spam)
Comment 113 rajor22913@ishense.com 2025-09-13 09:11:13 UTC Comment hidden (spam)
Comment 114 rajor22913@ishense.com 2025-09-13 09:13:04 UTC Comment hidden (spam)
Comment 115 cigas 2025-09-13 09:17:42 UTC Comment hidden (spam)
Comment 116 cowigal 2025-09-13 09:17:49 UTC Comment hidden (spam)
Comment 117 cowigal 2025-09-13 09:18:17 UTC Comment hidden (spam)
Comment 118 cigas 2025-09-13 09:20:14 UTC Comment hidden (spam)
Comment 119 pewihow 2025-09-13 09:22:06 UTC Comment hidden (spam)
Comment 120 cowigal 2025-09-13 09:22:11 UTC Comment hidden (spam)
Comment 121 cigas 2025-09-13 09:22:23 UTC Comment hidden (spam)
Comment 122 rajor22913@ishense.com 2025-09-13 09:23:34 UTC Comment hidden (spam)
Comment 123 cowigal 2025-09-13 09:27:37 UTC Comment hidden (spam)
Comment 124 rajor22913@ishense.com 2025-09-13 09:30:30 UTC Comment hidden (spam)
Comment 125 cigas 2025-09-13 09:31:50 UTC Comment hidden (spam)
Comment 126 cigas 2025-09-13 09:32:47 UTC Comment hidden (spam)
Comment 127 rajor22913@ishense.com 2025-09-13 09:32:59 UTC Comment hidden (spam)
Comment 128 cowigal 2025-09-13 09:39:35 UTC Comment hidden (spam)
Comment 129 cowigal 2025-09-13 09:40:05 UTC Comment hidden (spam)
Comment 130 rajor22913@ishense.com 2025-09-13 09:41:10 UTC Comment hidden (spam)
Comment 131 rajor22913@ishense.com 2025-09-13 09:41:39 UTC Comment hidden (spam)
Comment 132 cigas 2025-09-13 09:42:37 UTC Comment hidden (spam)
Comment 133 rajor22913@ishense.com 2025-09-13 09:46:12 UTC Comment hidden (spam)
Comment 134 rajor22913@ishense.com 2025-09-13 09:47:37 UTC Comment hidden (spam)
Comment 135 cowigal 2025-09-13 09:50:02 UTC Comment hidden (spam)
Comment 136 pewihow 2025-09-13 10:11:20 UTC Comment hidden (spam)
Comment 137 cigas 2025-09-13 10:12:26 UTC Comment hidden (spam)
Comment 138 cigas 2025-09-13 10:19:52 UTC Comment hidden (spam)
Comment 139 rajor22913@ishense.com 2025-09-13 10:20:38 UTC Comment hidden (spam)
Comment 140 cigas 2025-09-13 10:24:33 UTC Comment hidden (spam)
Comment 141 pewihow 2025-09-13 10:25:46 UTC Comment hidden (spam)
Comment 142 rajor22913@ishense.com 2025-09-13 10:27:59 UTC Comment hidden (spam)
Comment 143 rajor22913@ishense.com 2025-09-13 10:32:57 UTC Comment hidden (spam)
Comment 144 pewihow 2025-09-13 10:37:50 UTC Comment hidden (spam)
Comment 145 rajor22913@ishense.com 2025-09-13 12:58:13 UTC Comment hidden (spam)
Comment 146 pewihow 2025-09-13 12:59:30 UTC Comment hidden (spam)
Comment 147 pewihow 2025-09-13 13:38:17 UTC Comment hidden (spam)
Comment 148 Jack Harrison 2025-10-20 16:26:37 UTC Comment hidden (spam)
Comment 149 casinonevada127 2025-11-13 11:45:57 UTC Comment hidden (spam)
Comment 150 casinonevada127 2025-11-13 11:47:04 UTC Comment hidden (spam)
Comment 151 casinonevada127 2025-11-13 11:59:46 UTC Comment hidden (spam)
Comment 152 sonu 2025-11-18 18:24:28 UTC Comment hidden (spam)
Comment 153 sonu 2025-11-18 18:24:46 UTC Comment hidden (spam)
Comment 154 sonu 2025-11-18 18:25:35 UTC Comment hidden (spam)
Comment 155 dipa 2025-11-28 14:09:00 UTC Comment hidden (spam)
Comment 158 Callgirl4u 2026-01-28 10:07:52 UTC Comment hidden (spam)
Comment 159 yamikaur22 2026-02-09 06:07:33 UTC Comment hidden (spam)

Note You need to log in before you can comment on or make changes to this bug.