diff --git a/etc/README-valence.conf.txt b/etc/README-valence.conf.txt new file mode 100644 index 0000000..1349e83 --- /dev/null +++ b/etc/README-valence.conf.txt @@ -0,0 +1,9 @@ +To generate the sample valence.conf file, run the following +command from the top level of the valence directory: + +tox -egenconfig #Generates etc/valence.conf.sample + +If tox is not installed, you may install it as follows: + +$ sudo pip install tox + diff --git a/etc/os-config-generator/valence.conf b/etc/os-config-generator/valence.conf deleted file mode 100644 index 2ff27a9..0000000 --- a/etc/os-config-generator/valence.conf +++ /dev/null @@ -1,3 +0,0 @@ -[DEFAULT] -output_file = etc/valence/valence.conf.sample -namespace = valence.conf diff --git a/etc/valence.conf b/etc/valence.conf new file mode 100644 index 0000000..a05259a --- /dev/null +++ b/etc/valence.conf @@ -0,0 +1,3 @@ +[DEFAULT] +output_file = etc/valence.conf.sample +namespace = valence.conf diff --git a/etc/valence/valence.conf.sample b/etc/valence/valence.conf.sample deleted file mode 100644 index f51ea68..0000000 --- a/etc/valence/valence.conf.sample +++ /dev/null @@ -1,97 +0,0 @@ -[DEFAULT] - - -[api] - -# -# From valence.conf -# - -# The port for the valence API server. (port value) -# Minimum value: 0 -# Maximum value: 65535 -#bind_port = 8181 - -# The listen IP for the valence API server. (IP address value) -#bind_host = 127.0.0.1 - -# Enable the integrated stand-alone API to service requests via HTTPS -# instead of HTTP. If there is a front-end service performing HTTPS -# offloading from the service, this option should be False; note, you -# will want to change public API endpoint to represent SSL termination -# URL with 'public_endpoint' option. (boolean value) -#enable_ssl_api = false - -# Number of workers for valence-api service. The default will be the -# number of CPUs available. (integer value) -#workers = 4 - -# The maximum timeout to wait for valence API server to come up. -# (integer value) -#timeout = 1000 - -# The maximum number of items returned in a single response from a -# collection resource. (integer value) -#max_limit = 1000 - -# Configuration file for WSGI definition of API. (string value) -#api_paste_config = api-paste.ini - -# Enable debug mode for valence-api service. (boolean value) -#debug = false - -# The log file location for valence-api service (string value) -#log_file = /var/log/valence/valence.log - -# The granularity of Error log outputs. (string value) -#log_level = debug - -# The log format. (string value) -#log_format = %(asctime)s %(name)-4s %(levelname)-4s %(message)s - - -[etcd] - -# -# From valence.conf -# - -# The port for the etcd server. (port value) -# Minimum value: 0 -# Maximum value: 65535 -#port = 2379 - -# The listen IP for the etcd server. (IP address value) -#host = 127.0.0.1 - - -[podm] - -# -# From valence.conf -# - -# The URL of Redfish API server. (e.g.: http(s)://:/). -# Required. (string value) -#url = - -# User account with admin/server-profile access privilege. Although -# this property is not mandatory it's highly recommended to set a -# username. Optional. (string value) -#username = - -# User account password. Although this property is not mandatory, it's -# highly recommended to set a password. Optional. (string value) -#password = - -# Either a boolean value, a path to a CA_BUNDLE file or directory with -# certificates of trusted CAs. If set to True the driver will verify -# the host certificates; if False the driver will ignore verifying the -# SSL certificate; If it's a path the driver will use the specified -# certificate or one of the certificates in the directory. Defaults to -# True. Optional. (boolean value) -#verify_ca = - -# The URL extension that specifies the Redfish API version that -# valence will interact with (string value) -#base_ext = /redfish/v1/ diff --git a/install_valence.sh b/install_valence.sh index d093abd..1e4d105 100755 --- a/install_valence.sh +++ b/install_valence.sh @@ -30,13 +30,19 @@ sed "s/\${CHUID}/$CURR_USER/" "$DIR"/doc/source/init/valence.conf > /tmp/valenc sed -i "s#PYHOME#$PYHOME#" /tmp/valence.conf mv /tmp/valence.conf /etc/init/valence.conf +# Generate initial sample config file. +echo "Generating sample config file" >> $install_log +pip install tox +tox -egenconfig + # create conf directory for valence if it doesn't exist if [ ! -d "/etc/valence" ]; then mkdir /etc/valence fi chown "$CURR_USER":"$CURR_USER" /etc/valence VALENCE_CONF=/etc/valence/valence.conf -cp etc/valence/valence.conf.sample /etc/valence/valence.conf +cp etc/valence.conf.sample /etc/valence/valence.conf + sudo sed -i "s/#debug\s*=.*/debug=true/" $VALENCE_CONF sudo sed -i "s/#log_level\s*=.*/log_level=debug/" $VALENCE_CONF sudo sed -i "s/#log_file\s*=.*/log_file=/var/log/valence/valence.log/" $VALENCE_CONF diff --git a/tox.ini b/tox.ini index 445edea..daf3114 100644 --- a/tox.ini +++ b/tox.ini @@ -75,4 +75,4 @@ import-order-style = pep8 [testenv:genconfig] commands = - oslo-config-generator --config-file etc/os-config-generator/valence.conf --output-file etc/valence/valence.conf.sample + oslo-config-generator --config-file etc/valence.conf --output-file etc/valence.conf.sample