Correction de l'indentation
This commit is contained in:
@ -1,7 +1,7 @@
|
|||||||
FROM python
|
FROM debian
|
||||||
RUN <<-EOF
|
RUN <<-EOF
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y python3-cryptography python3-requests python3-toml
|
apt-get install -y systemd python3 python3-cryptography python3-requests python3-toml
|
||||||
EOF
|
EOF
|
||||||
ADD scripts\* /airwatchConnector
|
ADD scripts\* /airwatchConnector
|
||||||
ADD services.py
|
ADD services.py
|
||||||
|
|||||||
10
services.py
10
services.py
@ -10,9 +10,9 @@ confFiles = os.listdir(confDir)
|
|||||||
confFiles = [conf for conf in confFiles if os.path.isfile(f"{confDir}/{conf}") and not conf.endswith(".conf")]
|
confFiles = [conf for conf in confFiles if os.path.isfile(f"{confDir}/{conf}") and not conf.endswith(".conf")]
|
||||||
|
|
||||||
for conf in confFiles:
|
for conf in confFiles:
|
||||||
# On forme un nom à partir du nom du fichier de conf sans l'extension
|
# On forme un nom à partir du nom du fichier de conf sans l'extension
|
||||||
# et on enlève les espaces
|
# et on enlève les espaces
|
||||||
confName = conf[:5].replace(' ', '')
|
confName = conf[:5].replace(' ', '')
|
||||||
|
|
||||||
with open(f"{confDir}/{conf}", "r") as f:
|
with open(f"{confDir}/{conf}", "r") as f:
|
||||||
settings = toml.load(f)
|
settings = toml.load(f)
|
||||||
@ -24,8 +24,8 @@ for conf in confFiles:
|
|||||||
os.makedirs(f"{logDir}/{logPath}")
|
os.makedirs(f"{logDir}/{logPath}")
|
||||||
|
|
||||||
|
|
||||||
with open(f"/etc/systemd/system/{confName}-sync.service", "w") as f:
|
with open(f"/etc/systemd/system/{confName}-sync.service", "w") as f:
|
||||||
f.write(f"""[Unit]
|
f.write(f"""[Unit]
|
||||||
Description=Script Airwatch pour la synchronisation des données Airwatch et GLPI.
|
Description=Script Airwatch pour la synchronisation des données Airwatch et GLPI.
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
|
|||||||
Reference in New Issue
Block a user