cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject [38/50] [abbrv] git commit: updated refs/heads/marvin_refactor to b784012
Date Mon, 18 Nov 2013 08:50:45 GMT
marvin_refactor: exception handle for non-standard libraries

non-standard python libraries that are not installed by default on
python installations need to be exception handled appropriately

Signed-off-by: Prasanna Santhanam <tsp@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b006c993
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b006c993
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b006c993

Branch: refs/heads/marvin_refactor
Commit: b006c993f32d4fc6a337d706e1f6b02b503d390e
Parents: f1eb723
Author: Prasanna Santhanam <tsp@apache.org>
Authored: Wed Oct 2 11:28:44 2013 +0530
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Thu Oct 31 13:54:25 2013 +0530

----------------------------------------------------------------------
 tools/marvin/marvin/TestCaseExecuteEngine.py |  5 ++++-
 tools/marvin/marvin/cloudstackConnection.py  | 13 ++++++++-----
 tools/marvin/marvin/dbConnection.py          | 11 ++++++-----
 tools/marvin/marvin/remoteSSHClient.py       |  1 -
 tools/marvin/marvin/util.py                  |  1 -
 5 files changed, 18 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b006c993/tools/marvin/marvin/TestCaseExecuteEngine.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/TestCaseExecuteEngine.py b/tools/marvin/marvin/TestCaseExecuteEngine.py
index 6495000..c9796b8 100644
--- a/tools/marvin/marvin/TestCaseExecuteEngine.py
+++ b/tools/marvin/marvin/TestCaseExecuteEngine.py
@@ -15,7 +15,10 @@
 # specific language governing permissions and limitations
 # under the License.
 
-import unittest2 as unittest
+try:
+    import unittest2 as unittest
+except ImportError:
+    import unittest
 import os
 import sys
 import logging

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b006c993/tools/marvin/marvin/cloudstackConnection.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/cloudstackConnection.py b/tools/marvin/marvin/cloudstackConnection.py
index 0337b86..9dfc58b 100644
--- a/tools/marvin/marvin/cloudstackConnection.py
+++ b/tools/marvin/marvin/cloudstackConnection.py
@@ -15,7 +15,14 @@
 # specific language governing permissions and limitations
 # under the License.
 
-import requests
+try:
+    import requests
+    from requests import ConnectionError
+    from requests import HTTPError
+    from requests import Timeout
+    from requests import RequestException
+except ImportError:
+    raise Exception("requests installation not found. use pip install requests to continue")
 import urllib
 import base64
 import hmac
@@ -25,10 +32,6 @@ import time
 from marvin import cloudstackException
 from marvin.cloudstackAPI import *
 from marvin import jsonHelper
-from requests import ConnectionError
-from requests import HTTPError
-from requests import Timeout
-from requests import RequestException
 
 
 class CloudConnection(object):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b006c993/tools/marvin/marvin/dbConnection.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/dbConnection.py b/tools/marvin/marvin/dbConnection.py
index 99014ab..98c72c5 100644
--- a/tools/marvin/marvin/dbConnection.py
+++ b/tools/marvin/marvin/dbConnection.py
@@ -15,13 +15,14 @@
 # specific language governing permissions and limitations
 # under the License.
 
-import mysql
+try:
+    import mysql
+    from mysql import connector
+    from mysql.connector import errors
+except ImportError:
+    raise Exception("mysql-connector-python not installed. pip install mysql-connector-python
to continue")
 import contextlib
-from mysql import connector
-from mysql.connector import errors
-from contextlib import closing
 import cloudstackException
-import sys
 import os
 
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b006c993/tools/marvin/marvin/remoteSSHClient.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/remoteSSHClient.py b/tools/marvin/marvin/remoteSSHClient.py
index fea9b12..d64c82d 100644
--- a/tools/marvin/marvin/remoteSSHClient.py
+++ b/tools/marvin/marvin/remoteSSHClient.py
@@ -20,7 +20,6 @@ import time
 import cloudstackException
 import contextlib
 import logging
-from contextlib import closing
 
 
 class remoteSSHClient(object):

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b006c993/tools/marvin/marvin/util.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/util.py b/tools/marvin/marvin/util.py
index 9a97c9d..609e696 100644
--- a/tools/marvin/marvin/util.py
+++ b/tools/marvin/marvin/util.py
@@ -19,7 +19,6 @@ from marvin.entity.template import Template
 from marvin.entity.zone import Zone
 from marvin.entity.serviceoffering import ServiceOffering
 from marvin.entity.domain import Domain
-from marvin.entity.guestos import GuestOS
 
 def get_domain(apiclient):
     "Returns a default `ROOT` domain"


Mime
View raw message