blob: aaaf1747c09169ac6b5125f8e2056bb623791646 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import os
import sys
import subprocess
import shutil
import importlib
import utils
import initialize
from conf import conf
from conf import sf
from exceptions import MissingFile
import database
def boot(config, to_database = True):
out = utils.callsubprocess('boot', conf.boot_command, conf.boot_output, True)
value = None
try:
out = utils.callsubprocess('parse_command', conf.parse_command,
conf.parse_output, True)
value = float(out[0])
except Exception as e:
print("W: parse exception: " + e.__str__())
if to_database:
dtb = database.database()
dtb.add_measure(out, config.id, value)
|