From: Stavros Sachtouris Date: Fri, 26 Oct 2012 14:03:50 +0000 (+0300) Subject: Gracefull filenotfound error in store upload X-Git-Tag: v0.6~45 X-Git-Url: https://code.grnet.gr/git/kamaki/commitdiff_plain/436f2ce1e776056381a0b28635553e55c4bbf0f9 Gracefull filenotfound error in store upload --- diff --git a/kamaki/cli/commands/pithos_cli.py b/kamaki/cli/commands/pithos_cli.py index 2ad0ff8..e0cae0b 100644 --- a/kamaki/cli/commands/pithos_cli.py +++ b/kamaki/cli/commands/pithos_cli.py @@ -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() diff --git a/kamaki/clients/pithos_rest_api.py b/kamaki/clients/pithos_rest_api.py index 5978293..eba1f89 100644 --- a/kamaki/clients/pithos_rest_api.py +++ b/kamaki/clients/pithos_rest_api.py @@ -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): diff --git a/kamaki/clients/tests.py b/kamaki/clients/tests.py index 75a3fbe..9dc2328 100644 --- a/kamaki/clients/tests.py +++ b/kamaki/clients/tests.py @@ -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)