Gracefull filenotfound error in store upload
authorStavros Sachtouris <saxtouri@admin.grnet.gr>
Fri, 26 Oct 2012 14:03:50 +0000 (17:03 +0300)
committerStavros Sachtouris <saxtouri@admin.grnet.gr>
Fri, 26 Oct 2012 14:03:50 +0000 (17:03 +0300)
kamaki/cli/commands/pithos_cli.py
kamaki/clients/pithos_rest_api.py
kamaki/clients/tests.py

index 2ad0ff8..e0cae0b 100644 (file)
@@ -577,6 +577,8 @@ class store_upload(_store_container_command):
                     sharing=self.get_argument('sharing'), public=self.get_argument('public'))
         except ClientError as err:
             raiseCLIError(err)
+        except IOError as err:
+            raise CLIError(message='Failed to read form file %s'%local_path, importance=2, details=unicode(err))
         print 'Upload completed'
 
 @command()
index 5978293..eba1f89 100644 (file)
@@ -31,8 +31,8 @@
 # interpreted as representing official policies, either expressed
 # or implied, of GRNET S.A.
 
-from .storage import StorageClient, ClientError
-from .utils import path4url, list2str
+from kamaki.clients.storage import StorageClient, ClientError
+from kamaki.clients.utils import path4url, list2str
 
 class PithosRestAPI(StorageClient):
 
index 75a3fbe..9dc2328 100644 (file)
@@ -382,7 +382,7 @@ class testCyclades(unittest.TestCase):
                while wait < limit:
                        nics = self.client.list_server_nics(servid)
                        for net in nics:
-                               found_nic = net['id'] == netid
+                               found_nic = net['network_id'] == netid
                                if (in_creation and found_nic) or not (in_creation or found_nic):
                                        return True
                        dis = '' if in_creation else 'dis'
@@ -788,6 +788,7 @@ class testCyclades(unittest.TestCase):
                self.assertTrue('1' in [net['network_id'] for net in r])
 
                self.client.connect_server(self.server1['id'], self.network2['id'])
+               print('self.network2[id] %s'%self.network2)
                self.assertTrue(self._wait_for_nic(self.network2['id'], self.server1['id']))
                r = self.client.list_server_nics(self.server1['id'])
                self.assertTrue(len(r)>len0)