Skip to content

Commit

Permalink
Add internal.sudo subtask.
Browse files Browse the repository at this point in the history
  • Loading branch information
zmc committed Sep 5, 2013
1 parent 6d1ed57 commit d6e8b23
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions teuthology/run.py
Expand Up @@ -215,6 +215,7 @@ def main():
{'internal.base': None},
{'internal.archive': None},
{'internal.coredump': None},
{'internal.sudo': None},
{'internal.syslog': None},
{'internal.timer': None},
])
Expand Down
18 changes: 18 additions & 0 deletions teuthology/task/internal.py
Expand Up @@ -322,6 +322,24 @@ def archive(ctx, config):
),
)

@contextlib.contextmanager
def sudo(ctx, config):
log.info('Configuring sudo...')
sudoers_file = '/etc/sudoers'
tty_expr = 's/requiretty/!requiretty/'
pw_expr = 's/!visiblepw/visiblepw/'

run.wait(
ctx.cluster.run(
args="sudo sed -i -e '{tty_expr}' -e '{pw_expr}' {path}".format(
tty_expr=tty_expr, pw_expr=pw_expr, path=sudoers_file
),
wait=False,
)
)
yield


@contextlib.contextmanager
def coredump(ctx, config):
log.info('Enabling coredump saving...')
Expand Down

0 comments on commit d6e8b23

Please sign in to comment.