I'm putting ifstate on my laptop since i want to have multiple network namespaces, which as we both know are poorly supported outside of ifstate :). However the issue is that my laptop doesn't have a physical rj45 ethernet, therefore i carry around a dongle which i plug in when i need a rj45. Issues arise when i try to run ifstate with a interface that may not exists:
interfaces."eth1" = {
identify.perm_address = "xx:xx:xx:xx:xx:xx";
link = {
kind = "physical";
state = "up";
};
hooks = [
{
name = "dhcpcd";
args.IFACE = "eth1";
}
];
};
(i have 2 dongles, eth0 and eth1 as i call them, currently my laptop is docked, so eth0 is connected, eth1 is the portable one)
this then leads to ifstate erroring out:
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486]
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486] configure sysctl settings...
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486] ipv6/optimistic_dad ok
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486]
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486] configure interfaces...
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486] lo
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486] link ok
Jan 28 13:00:55 omen ifstatecli[55486]: addresses = 127.0.0.1/8
Jan 28 13:00:55 omen ifstatecli[55486]: addresses = ::1/128
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486] addresses = 127.0.0.1/8
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486] addresses = ::1/128
Jan 28 13:00:55 omen ifstatecli[55486]: eth0
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486] eth0
Jan 28 13:00:55 omen ifstatecli[55486]: link ok
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486] link ok
Jan 28 13:00:55 omen ifstatecli[55575]: read_config: /etc/dhcpcd.conf: No such file or directory
Jan 28 13:00:55 omen ifstatecli[55575]: sending commands to dhcpcd process
Jan 28 13:00:55 omen dhcpcd[55575]: read_config: /etc/dhcpcd.conf: No such file or directory
Jan 28 13:00:55 omen dhcpcd[55575]: sending commands to dhcpcd process
Jan 28 13:00:55 omen ifstatecli[55486]: hooks = dhcpcd
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486] hooks = dhcpcd
Jan 28 13:00:55 omen ifstatecli[55486]: eth1
Jan 28 13:00:55 omen ifstatecli[55486]: eth1 unable to create physical link
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486] eth1
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486] eth1 unable to create physical link
Jan 28 13:00:55 omen ifstatecli[55486]: eth1 link missing
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486] eth1 link missing
Jan 28 13:00:55 omen ifstate-apply[55486]: ifstate-apply[55486] eth1 link missing
Jan 28 13:00:55 omen ifstatecli[55486]: eth1 link missing
Jan 28 13:00:55 omen ifstatecli[55486]: AttributeError: 'PhysicalLink' object has no attribute 'iface'
I see two issues here:
- i would like to be able to tell ifstate to fully ignore missing interfaces, so that if i end up searching the logs for warnings or in some other way looking for warnings, i dont get false positives
- ifstate exits with a unhandled exception
ifstatecli --version reports:
ifstatecli 2.2.3