~matsubara/maas/wait-to-configure-cluster

« back to all changes in this revision

Viewing changes to utils.py

  • Committer: Tarmac
  • Author(s): Diogo Matsubara
  • Date: 2013-12-13 13:58:43 UTC
  • mfrom: (227.1.17 adt-update)
  • Revision ID: tarmac-20131213135843-tgtjwim6cw8sjkt5
[r=rvb][bug=][author=matsubara] Changes tests to work with a non-forked version of auto-package-testing.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
import platform
6
6
import errno
7
7
import os
 
8
import pwd
8
9
from time import sleep, time
9
10
import signal
10
11
 
19
20
    pass
20
21
 
21
22
 
 
23
def change_logs_permissions(log_dest):
 
24
    """Change logs permissions so auto-package-testing can access them."""
 
25
    ubuntu_user = pwd.getpwnam('ubuntu')
 
26
    uid, gid = ubuntu_user.pw_uid, ubuntu_user.pw_gid
 
27
    for root, dirs, files in os.walk(log_dest):
 
28
        for d in dirs:
 
29
            os.chown(os.path.join(root, d), uid, gid)
 
30
        for f in files:
 
31
            os.chown(os.path.join(root, f), uid, gid)
 
32
 
 
33
 
22
34
def is_juju_core():
23
35
    """Report if 'juju' is provider by juju-core."""
24
36
    retcode, out, err = run_command(['juju', '--version'])