Skip to content

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

Open
@morsik

Description

@morsik

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedValid issue that we intend to work on when we have the bandwidthbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions