Bug 1304643 - [ovirt-shell] more portable ovirt-shell
[ovirt-shell] more portable ovirt-shell
Status: CLOSED CURRENTRELEASE
Product: ovirt-engine-cli
Classification: oVirt
Component: General (Show other bugs)
3.6.2.0
Unspecified Unspecified
unspecified Severity low (vote)
: ovirt-4.0.2
: 3.6.8.0
Assigned To: Juan Hernández
Jiri Belka
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-04 04:21 EST by Jiri Belka
Modified: 2016-07-26 06:54 EDT (History)
6 users (show)

See Also:
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 06:54:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: Infra
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
rule-engine: ovirt‑4.0.z+
rule-engine: planning_ack+
oourfali: devel_ack+
pstehlik: testing_ack+


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
oVirt gerrit 53133 master MERGED Make ovirt-engine-cli more portable: - replace sys.platform with os.name posix 2016-04-06 07:42 EDT
oVirt gerrit 59740 cli_3.6 MERGED Make ovirt-engine-cli more portable: - replace sys.platform with os.name posix 2016-07-05 03:51 EDT

  None (edit)
Description Jiri Belka 2016-02-04 04:21:16 EST
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 05:24:52 EST
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 18:50:27 EDT
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune@redhat.com with any questions
Comment 3 Juan Hernández 2016-04-06 07:45:53 EDT
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 06:54:23 EDT
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

Note You need to log in before you can comment on or make changes to this bug.