fix(hook): honour NetBox attribute restrictions in command aliases
Generated command aliases checked commands.*.match against hosts without
their status, site, role, platform and tenant, so a restriction such as
match: {platform: junos} produced no aliases.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c87c2623ec
commit
c408d529a0
2 files changed
+21
-1
No files matched your search
@@ -172,7 +172,8 @@ func BuildAliasEntries(entries []cache.Entry, cfg config.Config) []AliasEntry {
|
||||
hostname = instance
|
||||
instance = ""
|
||||
}
|
||||
hostMetadata[e.Name] = config.SSHHost{Instance: instance, Name: hostname, Kind: e.Kind, Tags: e.Tags}
|
||||
hostMetadata[e.Name] = config.SSHHost{Instance: instance, Name: hostname, Kind: e.Kind, Tags: e.Tags, Status: e.Status,
|
||||
Site: cache.RefOf(e.Site), Role: cache.RefOf(e.Role), Platform: cache.RefOf(e.Platform), Tenant: cache.RefOf(e.Tenant)}
|
||||
}
|
||||
var commands []string
|
||||
for name := range cfg.Commands {
|
||||
|
||||
Reference in new issue
Block a user