Bug 1304643

Summary: [ovirt-shell] more portable ovirt-shell
Product: [oVirt] ovirt-engine-cli Reporter: Jiri Belka <jbelka>
Component: GeneralAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: Jiri Belka <jbelka>
Severity: low Docs Contact:
Priority: unspecified    
Version: 3.6.2.0CC: bugs, jbelka, lsvaty, oourfali, pstehlik, sbonazzo
Target Milestone: ovirt-4.0.2Keywords: Reopened
Target Release: 3.6.8.0Flags: rule-engine: ovirt-4.0.z+
rule-engine: planning_ack+
oourfali: devel_ack+
pstehlik: testing_ack+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: ovirt-engine-cli-3.6.8.0 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-26 10:54:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jiri Belka 2016-02-04 09:21:16 UTC
Description of problem:

these diffs i have for my ovirt-engine-cli port, would be nice if merged so i don't need to keep them.

~~~
$OpenBSD$
--- src/cli/platform/__init__.py.orig   Mon Nov 16 15:56:08 2015
+++ src/cli/platform/__init__.py        Wed Feb  3 14:51:35 2016
@@ -1,9 +1,9 @@
 
-import sys
+import os
 
-if sys.platform in ('linux2',):
+if os.name == "posix":
     from cli.platform.posix.terminal import PosixTerminal as Terminal
     from cli.platform.posix.util import *
 
-elif sys.platform in ('win32',):
+else:
     pass
$OpenBSD$
--- src/ovirtcli/platform/__init__.py.orig      Mon Nov 16 15:56:08 2015
+++ src/ovirtcli/platform/__init__.py   Wed Feb  3 14:51:31 2016
@@ -1,11 +1,11 @@
 
-import sys
+import os
 
-if sys.platform in ('linux2',):
+if os.name == "posix":
     from ovirtcli.platform.posix import util
     from ovirtcli.platform.posix import vnc
     from ovirtcli.platform.posix import spice
     from ovirtcli.platform.posix import ssh
 
-elif sys.platform in ('win32',):
+else:
     pass
$OpenBSD$
--- src/ovirtcli/platform/windows/__init__.py.orig      Mon Nov 16 15:56:08 2015
+++ src/ovirtcli/platform/windows/__init__.py   Wed Feb  3 14:51:55 2016
@@ -1,10 +1,10 @@
 
-import sys
+import os
 
-if sys.platform in ('linux2',):
+if os.name == "posix":
     from src.ovirtcli.platform.posix import util
     from src.ovirtcli.platform.posix import vnc
     from src.ovirtcli.platform.posix import spice
 
-elif sys.platform in ('win32',):
+else:
     pass
~~~

Version-Release number of selected component (if applicable):
3.6.x

How reproducible:
100%

Steps to Reproduce:
1. test ovirt-shell on non-linux OS
2. some stuff won't work as there's hardcoded 'linux2'
3.

Actual results:
hardcoded 'linux2'

Expected results:
should work on posix

Additional info:
tested on OpenBSD, works ok

Comment 1 Juan Hernández 2016-02-04 10:24:52 UTC
Jiri, your patches look good to me, would you mind submitting them change as patches to gerrit.ovirt.org?

Comment 2 Mike McCune 2016-03-28 22:50:27 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 3 Juan Hernández 2016-04-06 11:45:53 UTC
The fix for this issue has been merged to the master branch of the CLI. However, there won't be a 4.x release of the CLI, at least not for release 4 of the engine. I'm closing this as WONTFIX. We may reopen it if we eventually decide to have a 4.x release of the CLI for a later release of the oVirt project.

Comment 4 Lukas Svaty 2016-07-26 10:54:23 UTC
This bug was fixed and is slated to be in the upcoming version. As we
are focusing our testing at this phase on severe bugs, this bug was
closed without going through its verification step. If you think this
bug should be verified by QE, please set its severity to high and move
it back to ON_QA