Skip to content

Commit

Permalink
Merge branch 'release/0.2.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
swayf committed Jan 19, 2016
2 parents 2dc1577 + 27b84d2 commit d8e946d
Show file tree
Hide file tree
Showing 16 changed files with 34 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -6,6 +6,6 @@ install:
- pip install . --use-mirrors
- pip install -r test_requirements.txt --use-mirrors
script:
- nosetests --with-coverage --cover-erase --cover-branches --cover-package=proxmoxer.backends.https -w tests
- nosetests --with-coverage --cover-erase --cover-branches --cover-package=proxmoxer -w tests
after_success:
- coveralls
5 changes: 5 additions & 0 deletions README.rst
Expand Up @@ -169,6 +169,11 @@ Roadmap
History
-------

0.2.2 (2016-01-19)
..................
* Adding sudo to execute pvesh CLI in openssh backend (`Wei Tie <https://github.com/TieWei>`_, `Srinivas Sakhamuri <https://github.com/srsakhamuri>`_)
* Add support to specify an identity file for ssh connections (`Srinivas Sakhamuri <https://github.com/srsakhamuri>`_)

0.2.1 (2015-05-02)
..................
* fix for python 3.4 (`kokuev <https://github.com/kokuev>`_)
Expand Down
4 changes: 2 additions & 2 deletions proxmoxer/__init__.py
@@ -1,6 +1,6 @@
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__version__ = '0.2.1'
__copyright__ = '(c) Oleg Butovich 2013-2016'
__version__ = '0.2.2'
__licence__ = 'MIT'

from .core import *
2 changes: 1 addition & 1 deletion proxmoxer/backends/__init__.py
@@ -1,3 +1,3 @@
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__copyright__ = '(c) Oleg Butovich 2013-2016'
__licence__ = 'MIT'
2 changes: 1 addition & 1 deletion proxmoxer/backends/base_ssh.py
@@ -1,5 +1,5 @@
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__copyright__ = '(c) Oleg Butovich 2013-2016'
__licence__ = 'MIT'


Expand Down
2 changes: 1 addition & 1 deletion proxmoxer/backends/https.py
@@ -1,5 +1,5 @@
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__copyright__ = '(c) Oleg Butovich 2013-2016'
__licence__ = 'MIT'


Expand Down
19 changes: 14 additions & 5 deletions proxmoxer/backends/openssh.py
@@ -1,5 +1,5 @@
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__copyright__ = '(c) Oleg Butovich 2013-2016'
__licence__ = 'MIT'


Expand All @@ -19,19 +19,26 @@ def __init__(self, host,
configfile=None,
port=22,
timeout=5,
forward_ssh_agent=False):
forward_ssh_agent=False,
sudo=False,
identity_file=None):
self.host = host
self.username = username
self.configfile = configfile
self.port = port
self.timeout = timeout
self.forward_ssh_agent = forward_ssh_agent
self.sudo = sudo
self.identify_file = identity_file
self.ssh_client = openssh_wrapper.SSHConnection(self.host,
login=self.username,
port=self.port,
timeout=self.timeout)
timeout=self.timeout,
identify_file=self.identify_file)

def _exec(self, cmd):
if self.sudo:
cmd = "sudo " + cmd
ret = self.ssh_client.run(cmd, forward_ssh_agent=self.forward_ssh_agent)
return ret.stdout, ret.stderr

Expand All @@ -40,9 +47,11 @@ def upload_file_obj(self, file_obj, remote_path):


class Backend(BaseBackend):
def __init__(self, host, user, configfile=None, port=22, timeout=5, forward_ssh_agent=False):
def __init__(self, host, user, configfile=None, port=22, timeout=5, forward_ssh_agent=False, sudo=False, identity_file=None):
self.session = ProxmoxOpenSSHSession(host, user,
configfile=configfile,
port=port,
timeout=timeout,
forward_ssh_agent=forward_ssh_agent)
forward_ssh_agent=forward_ssh_agent,
sudo=sudo,
identity_file=identity_file)
2 changes: 1 addition & 1 deletion proxmoxer/backends/ssh_paramiko.py
@@ -1,5 +1,5 @@
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__copyright__ = '(c) Oleg Butovich 2013-2016'
__licence__ = 'MIT'


Expand Down
2 changes: 1 addition & 1 deletion proxmoxer/core.py
@@ -1,5 +1,5 @@
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__copyright__ = '(c) Oleg Butovich 2013-2016'
__licence__ = 'MIT'

import os
Expand Down
2 changes: 1 addition & 1 deletion test_requirements.txt
@@ -1,6 +1,6 @@
mock
nose
requests
requests < 2.9
coveralls
paramiko
openssh_wrapper
Expand Down
2 changes: 1 addition & 1 deletion tests/__init__.py
@@ -1,4 +1,4 @@
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__copyright__ = '(c) Oleg Butovich 2013-2016'
__licence__ = 'MIT'

2 changes: 1 addition & 1 deletion tests/base/__init__.py
@@ -1,4 +1,4 @@
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__copyright__ = '(c) Oleg Butovich 2013-2016'
__licence__ = 'MIT'

2 changes: 1 addition & 1 deletion tests/base/base_ssh_suite.py
@@ -1,5 +1,5 @@
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__copyright__ = '(c) Oleg Butovich 2013-2016'
__licence__ = 'MIT'

from itertools import islice
Expand Down
2 changes: 1 addition & 1 deletion tests/https_tests.py
@@ -1,5 +1,5 @@
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__copyright__ = '(c) Oleg Butovich 2013-2016'
__licence__ = 'MIT'

from mock import patch, MagicMock
Expand Down
2 changes: 1 addition & 1 deletion tests/openssh_tests.py
@@ -1,5 +1,5 @@
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__copyright__ = '(c) Oleg Butovich 2013-2016'
__licence__ = 'MIT'

from mock import patch
Expand Down
2 changes: 1 addition & 1 deletion tests/paramiko_tests.py
@@ -1,5 +1,5 @@
__author__ = 'Oleg Butovich'
__copyright__ = '(c) Oleg Butovich 2013-2015'
__copyright__ = '(c) Oleg Butovich 2013-2016'
__licence__ = 'MIT'

from mock import patch
Expand Down

0 comments on commit d8e946d

Please sign in to comment.