Allow --discoverable option to be set via profiles (ref: #159)
This commit is contained in:
@@ -120,6 +120,16 @@ func CobraRunE(cmd *cobra.Command, args []string) error {
|
||||
p.IpmiInterface.Set(SetIpmiInterface)
|
||||
}
|
||||
|
||||
if SetDiscoverable {
|
||||
wwlog.Printf(wwlog.VERBOSE, "Profile: %s, Setting all nodes to discoverable\n", p.Id.Get())
|
||||
p.Discoverable.SetB(true)
|
||||
}
|
||||
|
||||
if SetUndiscoverable {
|
||||
wwlog.Printf(wwlog.VERBOSE, "Profile: %s, Setting all nodes to undiscoverable\n", p.Id.Get())
|
||||
p.Discoverable.SetB(false)
|
||||
}
|
||||
|
||||
if SetNetDevDel {
|
||||
if SetNetDev == "" {
|
||||
wwlog.Printf(wwlog.ERROR, "You must include the '--netdev' option\n")
|
||||
|
||||
@@ -56,6 +56,8 @@ var (
|
||||
SetType string
|
||||
SetNetDevDel bool
|
||||
SetNetDevDefault bool
|
||||
SetDiscoverable bool
|
||||
SetUndiscoverable bool
|
||||
SetInit string
|
||||
SetRoot string
|
||||
SetKey string
|
||||
@@ -123,6 +125,8 @@ func init() {
|
||||
baseCmd.PersistentFlags().BoolVarP(&SetAll, "all", "a", false, "Set all profiles")
|
||||
baseCmd.PersistentFlags().BoolVarP(&SetForce, "force", "f", false, "Force configuration (even on error)")
|
||||
baseCmd.PersistentFlags().BoolVarP(&SetYes, "yes", "y", false, "Set 'yes' to all questions asked")
|
||||
baseCmd.PersistentFlags().BoolVar(&SetDiscoverable, "discoverable", false, "Make this node discoverable")
|
||||
baseCmd.PersistentFlags().BoolVar(&SetUndiscoverable, "undiscoverable", false, "Remove the discoverable flag")
|
||||
}
|
||||
|
||||
// GetRootCommand returns the root cobra.Command for the application.
|
||||
|
||||
@@ -130,6 +130,9 @@ func (config *nodeYaml) FindAllNodes() ([]NodeInfo, error) {
|
||||
n.IpmiInterface.SetAlt(config.NodeProfiles[p].IpmiInterface, p)
|
||||
n.SystemOverlay.SetAlt(config.NodeProfiles[p].SystemOverlay, p)
|
||||
n.RuntimeOverlay.SetAlt(config.NodeProfiles[p].RuntimeOverlay, p)
|
||||
|
||||
n.Discoverable.SetAltB(config.NodeProfiles[p].Discoverable, p)
|
||||
|
||||
n.Root.SetAlt(config.NodeProfiles[p].Root, p)
|
||||
|
||||
for devname, netdev := range config.NodeProfiles[p].NetDevs {
|
||||
|
||||
Reference in New Issue
Block a user