Lines Matching refs:os
22 import os
74 if os.path.isdir(d):
77 if os.path.isdir('/run/systemd/resolve'):
78 os.chmod('/run/systemd/resolve', 0o755)
80 if os.path.isdir('/run/systemd/netif'):
81 os.chmod('/run/systemd/netif', 0o755)
85 os.environ['SYSTEMD_LOG_TARGET'] = 'journal'
88 os.makedirs(NETWORK_UNITDIR, exist_ok=True)
122 self.addCleanup(os.remove, path)
126 self.write_config(os.path.join(NETWORK_UNITDIR, unit_name), contents)
130 dropin_dir = os.path.join(NETWORK_UNITDIR, "{}.d".format(unit_name))
131 dropin_path = os.path.join(dropin_dir, "{}.conf".format(dropin_name))
133 os.makedirs(dropin_dir, exist_ok=True)
134 self.addCleanup(os.rmdir, dropin_dir)
137 self.addCleanup(os.remove, dropin_path)
145 with open(os.path.join('/sys/class/net', link, attribute)) as f:
437 with open(os.path.join(NETWORK_UNITDIR, self.config)) as f:
589 self.dnsmasq_log = os.path.join(self.workdir, 'dnsmasq.log')
590 lease_file = os.path.join(self.workdir, 'dnsmasq.leases')
626 os.makedirs(os.path.dirname(conf), exist_ok=True)
629 self.addCleanup(os.remove, conf)
650 vpn_dnsmasq_log = os.path.join(self.workdir, 'dnsmasq-vpn.log')
709 os.makedirs(os.path.dirname(conf), exist_ok=True)
712 self.addCleanup(os.remove, conf)
716 os.makedirs(os.path.dirname(negative), exist_ok=True)
719 self.addCleanup(os.remove, negative)
722 hosts = os.path.join(self.workdir, 'hosts')
771 if os.path.exists('/etc/hostname'):
809 if not os.path.exists('/etc/hostname'):
850 self.addCleanup(os.remove, script)
851 with os.fdopen(fd, 'w+') as f:
893 os.fchmod(fd, 0o755)