Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Fixes #900: Removes '0' from the list of valid ports #972

Merged
merged 1 commit into from
Jun 7, 2016

Conversation

tjmcs
Copy link
Contributor

@tjmcs tjmcs commented Jun 6, 2016

Fixes #900

Summary of changes:

  • Removes '0' from the list of valid ports that the RESTful API can be started on (as such, since a non-zero port must be specified or the default port used, the RESTful API will not have a port dynamically assigned when snapd starts up so there is no need to display the port that was chosen in the log file)
  • Refactored how the command-line flags are set so that the command-line flags for each package are set locally in a flags.go file for that package rather than having the command-line flags for the options from some packages set in a package-level flags.go file and while the command-line flags for the options for other packages are set in the snapd.go file
  • Modified the code that sets the command-line flags so that those that are displaying an example value display the default value for that option in the --help output for snapd (rather than displaying values like '0' for command-line options like the --api-port)

Testing done:

  • Tested by attempting to start snapd with the port set to zero in the global configuration file and observing the error that results, then by starting it with a non-zero port in that same configuration file and observing the successful startup. Also ensured that the --help output for snapd could be generated successfully with the refactored command-line option code in this PR.

@intelsdi-x/snap-maintainers

…ST API can be started on; also refactors how command-line flags are set and prints valid defaults where applicable
@tjmcs tjmcs force-pushed the tb/port-zero-invalid branch from 6ef788d to 4f7afa7 Compare June 7, 2016 18:16
@jcooklin
Copy link
Collaborator

jcooklin commented Jun 7, 2016

LGTM

@jcooklin jcooklin merged commit 3777f43 into intelsdi-x:master Jun 7, 2016
@tjmcs tjmcs deleted the tb/port-zero-invalid branch June 7, 2016 23:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants