wip
This commit is contained in:
parent
1a5e3cd388
commit
ca0966a33b
3 changed files with 12 additions and 7 deletions
|
@ -32,7 +32,7 @@ actions = {
|
||||||
hosts = {}
|
hosts = {}
|
||||||
|
|
||||||
for source in node.metadata.get('apt/sources'):
|
for source in node.metadata.get('apt/sources'):
|
||||||
host = urlparse(source.split()[1]).hostname
|
host = repo.libs.apt.AptSource(source).url.hostname
|
||||||
hosts\
|
hosts\
|
||||||
.setdefault(host, set())\
|
.setdefault(host, set())\
|
||||||
.add(source)
|
.add(source)
|
||||||
|
|
2
bundles/influxdb2/items.py
Normal file
2
bundles/influxdb2/items.py
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
#sudo systemctl unmask influxdb.service
|
||||||
|
#sudo systemctl start influxdb
|
15
libs/apt.py
15
libs/apt.py
|
@ -1,15 +1,18 @@
|
||||||
# https://manpages.debian.org/jessie/apt/sources.list.5.de.html
|
# https://manpages.debian.org/jessie/apt/sources.list.5.de.html
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from re import search, sub
|
from re import match, search, sub
|
||||||
|
|
||||||
|
|
||||||
class AptSource():
|
class AptSource():
|
||||||
def __init__(self, string):
|
def __init__(self, string):
|
||||||
self.options = {
|
if match(r'\[.*\]', string):
|
||||||
k:v.split('=') for k,v in (
|
self.options = {
|
||||||
e.split('=') for e in search(r'\[(.*)\]', string)[1].split()
|
k:v.split('=') for k,v in (
|
||||||
)
|
e.split('=') for e in search(r'\[(.*)\]', string)[1].split()
|
||||||
}
|
)
|
||||||
|
}
|
||||||
|
else:
|
||||||
|
self.options = {}
|
||||||
parts = sub(r'\[.*\]', '', string).split()
|
parts = sub(r'\[.*\]', '', string).split()
|
||||||
self.type = parts[0]
|
self.type = parts[0]
|
||||||
self.url = urlparse(parts[1])
|
self.url = urlparse(parts[1])
|
||||||
|
|
Loading…
Reference in a new issue