~canonical-platform-qa/ubuntu-system-tests/qemu-build-snap

« back to all changes in this revision

Viewing changes to ubuntu_system_tests/helpers/ubuntuuitoolkit/units.py

  • Committer: Tarmac
  • Author(s): Sergio Cazzolato, Santiago Baldassin, Heber Parrucci
  • Date: 2016-11-24 17:40:34 UTC
  • mfrom: (471.1.32 systemd-support)
  • Revision ID: tarmac-20161124174034-4isut3l7bveaenxc
Adding changes to support systemd in the target device.

Approved by Sergio Cazzolato, Richard Huddie, platform-qa-bot, Heber Parrucci.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
import os
20
20
 
21
 
from ubuntu_system_tests.helpers.ubuntuuitoolkit import environment
22
 
 
 
21
from ubuntu_system_tests.helpers.init_systems import get_init_system
23
22
 
24
23
ENV_GRID_UNIT_PX = 'GRID_UNIT_PX'
25
24
DEFAULT_GRID_UNIT_PX = 8
26
25
 
27
26
 
28
27
def get_grid_unit():
29
 
    grid_unit_px = os.environ.get(ENV_GRID_UNIT_PX, None)
30
 
    if not grid_unit_px and environment.is_initctl_env_var_set(
31
 
            ENV_GRID_UNIT_PX):
32
 
        grid_unit_px = environment.get_initctl_env_var(ENV_GRID_UNIT_PX)
33
 
    return float(grid_unit_px or DEFAULT_GRID_UNIT_PX)
 
28
    return float(os.environ.get(ENV_GRID_UNIT_PX) or
 
29
                 get_init_system().get_env_variable(ENV_GRID_UNIT_PX) or
 
30
                 DEFAULT_GRID_UNIT_PX)
34
31
 
35
32
 
36
33
def gu(value):