From a7f6ddb05a077ad480fb5548a4f8cd90de425e5f Mon Sep 17 00:00:00 2001 From: Sebastian Goscik Date: Tue, 23 Feb 2016 17:07:20 +0000 Subject: [PATCH] LocalConnection: Added a `password` parameter This means it can now be set programatically and not always require a prompt. --- devlib/host.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/devlib/host.py b/devlib/host.py index 29ac4f0..80c96b4 100644 --- a/devlib/host.py +++ b/devlib/host.py @@ -28,12 +28,12 @@ class LocalConnection(object): name = 'local' - def __init__(self, timeout=10, keep_password=True, unrooted=False): + def __init__(self, timeout=10, keep_password=True, unrooted=False, password=None): self.logger = logging.getLogger('local_connection') self.timeout = timeout self.keep_password = keep_password self.unrooted = unrooted - self.password = None + self.password = password def push(self, source, dest, timeout=None, as_root=False): # pylint: disable=unused-argument self.logger.debug('cp {} {}'.format(source, dest)) @@ -77,4 +77,3 @@ class LocalConnection(object): if self.keep_password: self.password = password return password -