Michael Pasternak has uploaded a new change for review.

Change subject: cli: remove pexpect dependency
......................................................................

cli: remove pexpect dependency

GetKeyCommand is a deprecated POC that no longer maintained/supported,
since pexpect was forked in latest fedora, and this is only pexpect owner,
this patch removes both GetKeyCommand and pexpect/pexpect-u dependency.

Change-Id: Ief144fc7f32844a08463a497f2b483703d6ec0d3
Signed-off-by: Michael pasternak <[email protected]>
---
M ovirt-engine-cli.spec.in
M setup.py
M src/ovirtcli/command/__init__.py
D src/ovirtcli/command/getkey.py
M src/ovirtcli/context.py
M src/ovirtcli/platform/__init__.py
M src/ovirtcli/platform/posix/__init__.py
7 files changed, 1 insertion(+), 81 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine-cli refs/changes/00/14300/1

diff --git a/ovirt-engine-cli.spec.in b/ovirt-engine-cli.spec.in
index 6e387e7..9855a69 100644
--- a/ovirt-engine-cli.spec.in
+++ b/ovirt-engine-cli.spec.in
@@ -16,7 +16,6 @@
 
 Requires: python
 Requires: ovirt-engine-sdk >= 3.3.0.2
-Requires: pexpect
 Requires: python-setuptools
 Requires: python-ply
 Requires: python-kitchen
diff --git a/setup.py b/setup.py
index 6c1a102..9b30285 100755
--- a/setup.py
+++ b/setup.py
@@ -30,7 +30,7 @@
                  'ovirtcli.platform', 'ovirtcli.platform.posix',
                  'ovirtcli.platform.windows', 'ovirtcli.shell', 
'ovirtcli.utils', 'cli',
                  'cli.command', 'cli.platform', 'cli.platform.posix'],
-    install_requires=[ 'ovirt-engine-sdk >= 3.3.0.2-SNAPSHOT', 'pexpect-u >= 
2.3', 'ply >= 3.3', 'kitchen >= 1' ],
+    install_requires=[ 'ovirt-engine-sdk >= 3.3.0.2-SNAPSHOT', 'ply >= 3.3', 
'kitchen >= 1' ],
     entry_points={ 'console_scripts': [ 'ovirt-shell = ovirtcli.main:main' ] },
     **version_info
 )
diff --git a/src/ovirtcli/command/__init__.py b/src/ovirtcli/command/__init__.py
index 94c02bb..fb2b847 100644
--- a/src/ovirtcli/command/__init__.py
+++ b/src/ovirtcli/command/__init__.py
@@ -5,7 +5,6 @@
 from ovirtcli.command.console import ConsoleCommand
 from ovirtcli.command.remove import RemoveCommand
 from ovirtcli.command.disconnect import DisconnectCommand
-from ovirtcli.command.getkey import GetKeyCommand
 from ovirtcli.command.help import HelpCommand
 from ovirtcli.command.list import ListCommand
 from ovirtcli.command.ping import PingCommand
diff --git a/src/ovirtcli/command/getkey.py b/src/ovirtcli/command/getkey.py
deleted file mode 100644
index 2608b47..0000000
--- a/src/ovirtcli/command/getkey.py
+++ /dev/null
@@ -1,75 +0,0 @@
-#
-# Copyright (c) 2010 Red Hat, Inc.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#           http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-
-import logging
-
-from ovirtcli.platform import ssh, expect
-from ovirtcli.command.command import OvirtCommand
-from ovirtcli.command.getkey_cmd import dumpkey_function
-
-
-class GetKeyCommand(OvirtCommand):
-
-    name = 'getkey'
-    description = 'dump private ssh key'
-    args_check = 0
-
-    helptext = """\
-        == Usage ==
-
-        getkey
-
-        == Description ==
-
-        This commands dumps the private ssh key that oVirt manager is using to
-        communicate with the hypervisor nodes. It can be used to connect via
-        ssh to hypervisor nodes.
-        """
-
-    def execute(self):
-        terminal = self.context.terminal
-        connection = self.check_connection()
-        host = connection.host
-        terminal.stdout.write('Enter password for root@%s: ' % host)
-        terminal.stdout.flush()
-        terminal.set_echo(False)
-        passwd = terminal.stdin.readline()
-        terminal.set_echo(True)
-        terminal.stdout.write('\n')
-        if not passwd:
-            terminal.stdout.write('No password entered\n')
-            return
-        cmd = ssh.create_password_login_command('root', host)
-        logging.debug('ssh command is: %s' % cmd)
-        child = expect.spawn(cmd, timeout=4)
-        child.expect('password:')
-        child.send(passwd + '\n')
-        ix = child.expect(['# ', 'password:'])
-        if ix == 1:
-            terminal.stdout.write('Illegal password for root@%s\n' % host)
-            return
-        child.send(dumpkey_function)
-        child.expect('# ')
-        child.send('dumpkey /etc/pki/rhevm/.keystore rhevm mypass\n')
-        child.expect('-----BEGIN PRIVATE KEY-----\r\n')
-        terminal.stdout.write(child.match.group(0))
-        child.expect('-----END PRIVATE KEY-----\r\n')
-        terminal.stdout.write(child.before)
-        terminal.stdout.write(child.match.group(0))
-        child.send('exit\n')
-        child.expect(expect.EOF)
-        child.close()
diff --git a/src/ovirtcli/context.py b/src/ovirtcli/context.py
index 425bf36..ded7041 100644
--- a/src/ovirtcli/context.py
+++ b/src/ovirtcli/context.py
@@ -102,7 +102,6 @@
         self.add_command(ConsoleCommand)
         self.add_command(RemoveCommand)
         self.add_command(DisconnectCommand)
-#        self.add_command(GetKeyCommand)
         self.add_command(HelpCommand)
         self.add_command(ListCommand)
         self.add_command(PingCommand)
diff --git a/src/ovirtcli/platform/__init__.py 
b/src/ovirtcli/platform/__init__.py
index 9813e0a..203169e 100644
--- a/src/ovirtcli/platform/__init__.py
+++ b/src/ovirtcli/platform/__init__.py
@@ -5,7 +5,6 @@
     from ovirtcli.platform.posix import util
     from ovirtcli.platform.posix import vnc
     from ovirtcli.platform.posix import spice
-    from ovirtcli.platform.posix import expect
     from ovirtcli.platform.posix import ssh
 
 elif sys.platform in ('win32',):
diff --git a/src/ovirtcli/platform/posix/__init__.py 
b/src/ovirtcli/platform/posix/__init__.py
index 8dba130..8b13789 100644
--- a/src/ovirtcli/platform/posix/__init__.py
+++ b/src/ovirtcli/platform/posix/__init__.py
@@ -1,2 +1 @@
 
-import pexpect as expect


--
To view, visit http://gerrit.ovirt.org/14300
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ief144fc7f32844a08463a497f2b483703d6ec0d3
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine-cli
Gerrit-Branch: master
Gerrit-Owner: Michael Pasternak <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to