Skip to content

Commit

Permalink
Add consul fingerprinter to builtin list; sort list; fix bad error in…
Browse files Browse the repository at this point in the history
… consul fingerprinter
  • Loading branch information
dadgar committed Nov 5, 2015
1 parent 5b067a3 commit 8e0ab77
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion client/fingerprint/consul.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (f *ConsulFingerprint) Fingerprint(config *client.Config, node *structs.Nod
// If we can't hit this URL consul is probably not running on this machine.
info, err := consulClient.Agent().Self()
if err != nil {
return false, fmt.Errorf("Failed to query consul for agent status: %s", err)
return false, nil
}

node.Attributes["consul.server"] = strconv.FormatBool(info["Config"]["Server"].(bool))
Expand Down
14 changes: 8 additions & 6 deletions client/fingerprint/fingerprint.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,28 @@ const EmptyDuration = time.Duration(0)
// fingerprints available, to provided an ordered iteration
var BuiltinFingerprints = []string{
"arch",
"consul",
"cpu",
"env_aws",
"env_gce",
"host",
"memory",
"storage",
"network",
"env_aws",
"env_gce",
"storage",
}

// builtinFingerprintMap contains the built in registered fingerprints
// which are available, corresponding to a key found in BuiltinFingerprints
var builtinFingerprintMap = map[string]Factory{
"arch": NewArchFingerprint,
"consul": NewConsulFingerprint,
"cpu": NewCPUFingerprint,
"env_aws": NewEnvAWSFingerprint,
"env_gce": NewEnvGCEFingerprint,
"host": NewHostFingerprint,
"memory": NewMemoryFingerprint,
"storage": NewStorageFingerprint,
"network": NewNetworkFingerprinter,
"env_aws": NewEnvAWSFingerprint,
"env_gce": NewEnvGCEFingerprint,
"storage": NewStorageFingerprint,
}

// NewFingerprint is used to instantiate and return a new fingerprint
Expand Down

0 comments on commit 8e0ab77

Please sign in to comment.