Bug 806133 - RFE: "Sane defaults" config file
Summary: RFE: "Sane defaults" config file
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: PressGang CCMS
Classification: Community
Component: CSProcessor
Version: 1.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Lee Newson
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-23 01:39 UTC by Joshua Wulf
Modified: 2014-10-19 23:00 UTC (History)
2 users (show)

Fixed In Version: 0.22.4
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-06-07 01:31:17 UTC


Attachments (Terms of Use)

Description Joshua Wulf 2012-03-23 01:39:01 UTC
Can we make a "works out of the box" (as much as possible) and "self-documenting" configuration file?

Something like this would be good:

[servers]
# The default url and username is used by commands like csprocessor list that aren't project-specific
# See: https://bugzilla.redhat.com/show_bug.cgi?id=803120

default.url = http://skynet.usersys.redhat.com:8080/TopicIndex
default.username = YOUR KERBEROS NAME HERE

test.url = http://skynet.usersys.redhat.com:8080/TopicIndex
test.username = YOUR KERBEROS NAME HERE

production.url = http://skynet.bne.redhat.com:8080/TopicIndex
production.username = YOUR KERBEROS NAME HERE

[directory]
root = 

[publican]
build.parameters = --langs=en-US --format=html-single
preview.format = html-single

Comment 1 Joshua Wulf 2012-03-23 01:44:17 UTC
When csprocessor is run and it sees "YOUR KERBEROS NAME HERE" in the ini file, it could say: "Please edit ~/.config/csprocessor.ini and set your username"

Comment 2 Lee Newson 2012-03-23 02:07:21 UTC
jwulf-108> so what about linking it with the other RFE which makes the default a reference
<jwulf-108> and put something like this:
<jwulf-108> # default = test
<jwulf-108> # default = production
<jwulf-108> # Uncomment one of the above servers
<lnewson> yeah i see no issues with that
<jwulf-108> and then the csprocessor could say:
<lnewson> that way it's all there and they just need to remove one comment symbol
<jwulf-108> "No default server is specified in ~/.config/csprocessor.ini. Do you need to uncomment one?"
<jwulf-108> if it doesn't find a default server

Comment 3 Lee Newson 2012-03-26 00:16:31 UTC
Added in 0.22.4

The new output is:

-------------------------------------------------
[servers]
# Uncomment one of the default servers below based on the server you wish to connect to.
#default=production
#default=test

#If you use one username for all servers then uncomment and set-up the below value instead of each servers username
#default.username=

# Production Server settings
production.url=http://skynet.cloud.lab.eng.bne.redhat.com:8080/TopicIndex/
production.username=

# Test Server settings
test.url=http://skynet.usersys.redhat.com:8080/TopicIndex/
test.username=

[directory]
root=

[publican]
build.parameters=--langs=en-US --format=html-single
preview.format=html-single
-------------------------------------------------

Note: I didn't include the "YOUR KERBEROS NAME HERE" as that will break part of the ease of having a default.username property. 

If the default server hasn't been uncommented and no server is specified by the command line or csprocessor.cfg then the following error will appear "No default server was found in the /home/lnewson/.config/csprocessor.ini configuration file. Perhaps you need to uncomment a default?"

If no username is entered then the error message "No username was specified for the server. Please check your configuration files and make sure a username exists." will be printed.

Comment 4 Lee Newson 2012-03-26 00:17:37 UTC
An example with the default.username property:

-------------------------------------------------
[servers]
# Uncomment one of the default servers below based on the server you wish to connect to.
#default=production
#default=test
default=local

#If you use one username for all servers then uncomment and set-up the below value instead of each servers username
default.username=lnewson

# Production Server settings
production.url=http://skynet.cloud.lab.eng.bne.redhat.com:8080/TopicIndex/
production.username=

# Test Server settings
test.url=http://skynet.usersys.redhat.com:8080/TopicIndex/
test.username=

# Local server settings
local.url=http://localhost:8080/TopicIndex/
local.username=

[directory]
root=

[publican]
build.parameters=--langs=en-US --format=html-single
preview.format=html-single
-------------------------------------------------

Comment 5 Lee Newson 2013-06-07 01:31:17 UTC
Closing and setting as current release as no QA was performed by the original reporter. If there is still an issue with this bug still than please re-open it.


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