Get _local_only value from environment variable

Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
Reformat following review

Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
Remove unneeded variable assignment

Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
Load all of time module

And add explicit calls to functions

Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>
Replace subprocess.Popen() by .check_output()

This also mean that unneeded sleep() are removed

Signed-off-by: Louis Bouchard <louis.bouchard@canonical.com>