mirror of
https://github.com/davidallendj/configurator.git
synced 2025-12-20 03:27:02 -07:00
Update generator interface and plugins
This commit is contained in:
parent
30c8336ca6
commit
e92a883c89
9 changed files with 85 additions and 5 deletions
|
|
@ -15,6 +15,14 @@ func (g *DnsMasq) GetName() string {
|
|||
return "dnsmasq"
|
||||
}
|
||||
|
||||
func (g *DnsMasq) GetVersion() string {
|
||||
return util.GitCommit()
|
||||
}
|
||||
|
||||
func (g *DnsMasq) GetDescription() string {
|
||||
return fmt.Sprintf("Configurator generator plugin for '%s'.", g.GetName())
|
||||
}
|
||||
|
||||
func (g *DnsMasq) Generate(config *configurator.Config, opts ...util.Option) (map[string][]byte, error) {
|
||||
// make sure we have a valid config first
|
||||
if config == nil {
|
||||
|
|
@ -50,7 +58,7 @@ func (g *DnsMasq) Generate(config *configurator.Config, opts ...util.Option) (ma
|
|||
// print message if verbose param found
|
||||
if verbose, ok := params["verbose"].(bool); ok {
|
||||
if verbose {
|
||||
fmt.Printf("template: \n%s\n ethernet interfaces found: %v\n", strings.Join(target.Templates, "\n\t"), len(eths))
|
||||
fmt.Printf("template: \n%s\nethernet interfaces found: %v\n", strings.Join(target.Templates, "\n\t"), len(eths))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue