added module for nextcloud state
This commit is contained in:
parent
5651437cd5
commit
e41c87c140
14
states/_modules/nextcloud.py
Normal file
14
states/_modules/nextcloud.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/usr/bin/python3
|
||||||
|
|
||||||
|
import re
|
||||||
|
|
||||||
|
def get_version(configfile=None):
|
||||||
|
res = None
|
||||||
|
regex = re.compile(".*OC_Version.*\((\d+),(\d+),(\d+),(\d+).*")
|
||||||
|
with open(configfile, "r") as f:
|
||||||
|
lines = f.readlines()
|
||||||
|
for l in lines:
|
||||||
|
res = regex.match(l.strip("\n"))
|
||||||
|
if res:
|
||||||
|
return ".".join(res.groups())
|
||||||
|
return ""
|
Loading…
Reference in New Issue
Block a user