Bug 806133 - RFE: "Sane defaults" config file
RFE: "Sane defaults" config file
Status: CLOSED CURRENTRELEASE
Product: PressGang CCMS
Classification: Community
Component: CSProcessor (Show other bugs)
1.x
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Lee Newson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-03-22 21:39 EDT by Joshua Wulf
Modified: 2014-10-19 19:00 EDT (History)
2 users (show)

See Also:
Fixed In Version: 0.22.4
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-06-06 21:31:17 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Joshua Wulf 2012-03-22 21:39:01 EDT
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-22 21:44:17 EDT
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-22 22:07:21 EDT
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-25 20:16:31 EDT
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-25 20:17:37 EDT
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-06 21:31:17 EDT
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.