Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't access fact that contains . in key #2750

Open
morsik opened this issue Sep 2, 2024 · 1 comment
Open

Can't access fact that contains . in key #2750

morsik opened this issue Sep 2, 2024 · 1 comment
Labels
accepted Valid issue that we intend to work on when we have the bandwidth bug Something isn't working

Comments

@morsik
Copy link

morsik commented Sep 2, 2024

Describe the Bug

Can't access fact that contains . in key

Expected Behavior

Data should be replied correctly, because network interface names contains dots when used VLANs.

Steps to Reproduce

Try to access IP from VLAN interface because those contain dot.

root@host ~ # facter networking.interfaces.ens1f0.ip
213.X.Y.Z
root@host ~ # facter networking.interfaces.ens1f0.4001.ip

root@host ~ # facter networking.interfaces."ens1f0.4001".ip

root@host ~ # facter 'networking.interfaces."ens1f0.4001".ip'

root@host ~ #

But this data actually exists!

# facter networking.interfaces
{
  eno8303 => {
    mac => "c4:cb:e1:XX:YY:ZZ",
    mtu => 1500
  },
  eno8403 => {
    mac => "c4:cb:e1:XX:YY:ZZ",
    mtu => 1500
  },
  ens1f0 => {
    bindings => [
      {
        address => "213.X.Y.Z",
        netmask => "255.255.255.128",
        network => "213.X.Y.Z"
      }
    ],
    ip => "213.X.Y.Z",
    mac => "6c:fe:54:XX:YY:ZZ",
    mtu => 1500,
    netmask => "255.255.255.128",
    network => "213.X.Y.Z"
  },
  ens1f0.4001 => {
    bindings => [
      {
        address => "10.X.Y.Z",
        netmask => "255.255.0.0",
        network => "10.X.Y.Z"
      }
    ],
    ip => "10.X.Y.Z",
    mac => "6c:fe:54:XX:YY:ZZ"
    mtu => 1400,
    netmask => "255.255.0.0",
    network => "10.X.Y.Z"
  },
  ens1f1 => {
    mac => "6c:fe:54:XX:YY:ZZ",
    mtu => 1500
  },
  lo => {
    bindings => [
      {
        address => "127.0.0.1",
        netmask => "255.0.0.0",
        network => "127.0.0.0"
      }
    ],
    ip => "127.0.0.1",
    mtu => 65536,
    netmask => "255.0.0.0",
    network => "127.0.0.0"
  }
}

Environment

  • Version: 7.23.0-1 (from Debian repo)
  • Platform: Debian 12
@morsik morsik added the bug Something isn't working label Sep 2, 2024
@joshcooper
Copy link
Contributor

Yes, facter 4 has some bugs with dotted notation. The main problem is it naively splits on dots. I have a feature branch here but it needs more work: main...joshcooper:dots_3447

@joshcooper joshcooper added the accepted Valid issue that we intend to work on when we have the bandwidth label Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted Valid issue that we intend to work on when we have the bandwidth bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants