From 9c4b4e6f0aeda63b025a4ff0b0c8acc91f9727fc Mon Sep 17 00:00:00 2001 From: branw Date: Sat, 11 Mar 2017 08:06:25 +0800 Subject: Add miss json moudle and fix license image view miss json moudle, fix some license, rename openstacksdk to vimsdk Change-Id: I976b2708cb11e6aa36689b3ca4054441d2df29c7 Issue-Id: MULTIVIM-36 Signed-off-by: branw --- vio/vio/__init__.py | 2 +- vio/vio/pub/__init__.py | 2 +- vio/vio/pub/config/__init__.py | 2 +- vio/vio/pub/config/config.py | 2 +- vio/vio/pub/database/__init__.py | 2 +- vio/vio/pub/database/models.py | 2 +- vio/vio/pub/exceptions.py | 2 +- vio/vio/pub/msapi/__init__.py | 2 +- vio/vio/pub/msapi/extsys.py | 2 +- vio/vio/pub/utils/__init__.py | 2 +- vio/vio/pub/utils/enumutil.py | 2 +- vio/vio/pub/utils/fileutil.py | 2 +- vio/vio/pub/utils/idutil.py | 2 +- vio/vio/pub/utils/restcall.py | 2 +- vio/vio/pub/utils/share_lock.py | 2 +- vio/vio/pub/utils/syscomm.py | 2 +- vio/vio/pub/utils/timeutil.py | 2 +- vio/vio/pub/utils/toscautil.py | 2 +- vio/vio/pub/utils/values.py | 2 +- vio/vio/pub/vim/const.py | 9 +- vio/vio/pub/vim/drivers/openstacksdk/__init__.py | 0 vio/vio/pub/vim/drivers/openstacksdk/cinder_v2.py | 51 -------- vio/vio/pub/vim/drivers/openstacksdk/compute.py | 95 --------------- vio/vio/pub/vim/drivers/openstacksdk/image_v2.py | 67 ----------- .../pub/vim/drivers/openstacksdk/keystone_v3.py | 34 ------ .../pub/vim/drivers/openstacksdk/neutron_v2_0.py | 87 -------------- vio/vio/pub/vim/drivers/openstacksdk/sdk.py | 132 --------------------- vio/vio/pub/vim/drivers/vimdriver.py | 22 ++-- vio/vio/pub/vim/drivers/vimsdk/__init__.py | 0 vio/vio/pub/vim/drivers/vimsdk/cinder_v2.py | 49 ++++++++ vio/vio/pub/vim/drivers/vimsdk/compute.py | 94 +++++++++++++++ vio/vio/pub/vim/drivers/vimsdk/image_v2.py | 62 ++++++++++ vio/vio/pub/vim/drivers/vimsdk/keystone_v3.py | 32 +++++ vio/vio/pub/vim/drivers/vimsdk/neutron_v2_0.py | 85 +++++++++++++ vio/vio/pub/vim/drivers/vimsdk/sdk.py | 130 ++++++++++++++++++++ vio/vio/pub/vim/vimapi/baseclient.py | 17 +-- vio/vio/pub/vim/vimapi/cinder/OperateVolume.py | 8 +- vio/vio/pub/vim/vimapi/glance/OperateImage.py | 14 +-- vio/vio/pub/vim/vimapi/keystone/OperateTenant.py | 9 +- vio/vio/pub/vim/vimapi/keystone/auth.py | 9 +- vio/vio/pub/vim/vimapi/network/OperateNetwork.py | 19 +-- vio/vio/pub/vim/vimapi/network/OperatePort.py | 19 +-- vio/vio/pub/vim/vimapi/network/OperateSubnet.py | 19 +-- vio/vio/pub/vim/vimapi/nova/OperateFlavors.py | 2 +- vio/vio/pub/vim/vimapi/nova/OperateHypervisor.py | 2 +- vio/vio/pub/vim/vimapi/nova/OperateLimits.py | 2 +- vio/vio/pub/vim/vimapi/nova/OperateNova.py | 2 +- vio/vio/pub/vim/vimapi/nova/OperateServers.py | 2 +- vio/vio/pub/vim/vimapi/nova/OperateService.py | 2 +- vio/vio/pub/vim/vimapi/nova/__init__.py | 2 +- vio/vio/samples/__init__.py | 2 +- vio/vio/samples/tests.py | 2 +- vio/vio/samples/urls.py | 2 +- vio/vio/samples/views.py | 2 +- vio/vio/settings.py | 2 +- vio/vio/swagger/__init__.py | 2 +- vio/vio/swagger/image_utils.py | 2 +- vio/vio/swagger/nova_utils.py | 2 +- vio/vio/swagger/tests.py | 2 +- vio/vio/swagger/urls.py | 2 +- vio/vio/swagger/views.py | 2 +- vio/vio/swagger/views/__init__.py | 2 +- vio/vio/swagger/views/flavor/__init__.py | 2 +- vio/vio/swagger/views/flavor/views.py | 3 +- vio/vio/swagger/views/hypervisor/views.py | 2 +- vio/vio/swagger/views/image/__init__.py | 2 +- vio/vio/swagger/views/image/views.py | 3 +- vio/vio/swagger/views/limits/views.py | 2 +- vio/vio/swagger/views/network/views.py | 2 +- vio/vio/swagger/views/port/views.py | 2 +- vio/vio/swagger/views/server/__init__.py | 2 +- vio/vio/swagger/views/server/views.py | 3 +- vio/vio/swagger/views/service/views.py | 2 +- vio/vio/swagger/views/subnet/views.py | 2 +- vio/vio/swagger/views/swagger_json.py | 2 +- vio/vio/swagger/views/tenant/__init__.py | 2 +- vio/vio/swagger/views/tenant/views.py | 2 +- vio/vio/swagger/views/volume/__init__.py | 2 +- vio/vio/swagger/views/volume/views.py | 2 +- vio/vio/swagger/volume_utils.py | 2 +- vio/vio/urls.py | 2 +- vio/vio/wsgi.py | 2 +- 82 files changed, 582 insertions(+), 600 deletions(-) delete mode 100644 vio/vio/pub/vim/drivers/openstacksdk/__init__.py delete mode 100644 vio/vio/pub/vim/drivers/openstacksdk/cinder_v2.py delete mode 100644 vio/vio/pub/vim/drivers/openstacksdk/compute.py delete mode 100644 vio/vio/pub/vim/drivers/openstacksdk/image_v2.py delete mode 100644 vio/vio/pub/vim/drivers/openstacksdk/keystone_v3.py delete mode 100644 vio/vio/pub/vim/drivers/openstacksdk/neutron_v2_0.py delete mode 100644 vio/vio/pub/vim/drivers/openstacksdk/sdk.py create mode 100644 vio/vio/pub/vim/drivers/vimsdk/__init__.py create mode 100644 vio/vio/pub/vim/drivers/vimsdk/cinder_v2.py create mode 100644 vio/vio/pub/vim/drivers/vimsdk/compute.py create mode 100644 vio/vio/pub/vim/drivers/vimsdk/image_v2.py create mode 100644 vio/vio/pub/vim/drivers/vimsdk/keystone_v3.py create mode 100644 vio/vio/pub/vim/drivers/vimsdk/neutron_v2_0.py create mode 100644 vio/vio/pub/vim/drivers/vimsdk/sdk.py diff --git a/vio/vio/__init__.py b/vio/vio/__init__.py index a8fe66a..12fa1e8 100644 --- a/vio/vio/__init__.py +++ b/vio/vio/__init__.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/__init__.py b/vio/vio/pub/__init__.py index a8fe66a..12fa1e8 100644 --- a/vio/vio/pub/__init__.py +++ b/vio/vio/pub/__init__.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/config/__init__.py b/vio/vio/pub/config/__init__.py index a8fe66a..12fa1e8 100644 --- a/vio/vio/pub/config/__init__.py +++ b/vio/vio/pub/config/__init__.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/config/config.py b/vio/vio/pub/config/config.py index 71a44aa..5c57d2e 100644 --- a/vio/vio/pub/config/config.py +++ b/vio/vio/pub/config/config.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/database/__init__.py b/vio/vio/pub/database/__init__.py index a8fe66a..12fa1e8 100644 --- a/vio/vio/pub/database/__init__.py +++ b/vio/vio/pub/database/__init__.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/database/models.py b/vio/vio/pub/database/models.py index d07dd6d..b12510a 100644 --- a/vio/vio/pub/database/models.py +++ b/vio/vio/pub/database/models.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/exceptions.py b/vio/vio/pub/exceptions.py index 7ebdcc6..394685a 100644 --- a/vio/vio/pub/exceptions.py +++ b/vio/vio/pub/exceptions.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/msapi/__init__.py b/vio/vio/pub/msapi/__init__.py index a8fe66a..12fa1e8 100644 --- a/vio/vio/pub/msapi/__init__.py +++ b/vio/vio/pub/msapi/__init__.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/msapi/extsys.py b/vio/vio/pub/msapi/extsys.py index 263d910..002f3ad 100644 --- a/vio/vio/pub/msapi/extsys.py +++ b/vio/vio/pub/msapi/extsys.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/utils/__init__.py b/vio/vio/pub/utils/__init__.py index a8fe66a..12fa1e8 100644 --- a/vio/vio/pub/utils/__init__.py +++ b/vio/vio/pub/utils/__init__.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/utils/enumutil.py b/vio/vio/pub/utils/enumutil.py index 334eb0c..717dc92 100644 --- a/vio/vio/pub/utils/enumutil.py +++ b/vio/vio/pub/utils/enumutil.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/utils/fileutil.py b/vio/vio/pub/utils/fileutil.py index e9ea4bb..07b5124 100644 --- a/vio/vio/pub/utils/fileutil.py +++ b/vio/vio/pub/utils/fileutil.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/utils/idutil.py b/vio/vio/pub/utils/idutil.py index 95421b7..5d35a7f 100644 --- a/vio/vio/pub/utils/idutil.py +++ b/vio/vio/pub/utils/idutil.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/utils/restcall.py b/vio/vio/pub/utils/restcall.py index 67bf1f6..0d7fd25 100644 --- a/vio/vio/pub/utils/restcall.py +++ b/vio/vio/pub/utils/restcall.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/utils/share_lock.py b/vio/vio/pub/utils/share_lock.py index bc541e7..10ab225 100755 --- a/vio/vio/pub/utils/share_lock.py +++ b/vio/vio/pub/utils/share_lock.py @@ -5,7 +5,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/utils/syscomm.py b/vio/vio/pub/utils/syscomm.py index f32af8b..833a290 100644 --- a/vio/vio/pub/utils/syscomm.py +++ b/vio/vio/pub/utils/syscomm.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/utils/timeutil.py b/vio/vio/pub/utils/timeutil.py index 03efd97..179cbb1 100644 --- a/vio/vio/pub/utils/timeutil.py +++ b/vio/vio/pub/utils/timeutil.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/utils/toscautil.py b/vio/vio/pub/utils/toscautil.py index 0c5f7bb..08307a6 100644 --- a/vio/vio/pub/utils/toscautil.py +++ b/vio/vio/pub/utils/toscautil.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/utils/values.py b/vio/vio/pub/utils/values.py index f43f8de..ea705dd 100644 --- a/vio/vio/pub/utils/values.py +++ b/vio/vio/pub/utils/values.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/vim/const.py b/vio/vio/pub/vim/const.py index 9580148..a6bd797 100644 --- a/vio/vio/pub/vim/const.py +++ b/vio/vio/pub/vim/const.py @@ -1,16 +1,15 @@ -# Copyright 2016 ZTE Corporation. +# Copyright (c) 2017 VMware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# You may obtain a copy of the License at: # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. + VIM_OPENSTACK = "vmware" diff --git a/vio/vio/pub/vim/drivers/openstacksdk/__init__.py b/vio/vio/pub/vim/drivers/openstacksdk/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/vio/vio/pub/vim/drivers/openstacksdk/cinder_v2.py b/vio/vio/pub/vim/drivers/openstacksdk/cinder_v2.py deleted file mode 100644 index 0e0c11c..0000000 --- a/vio/vio/pub/vim/drivers/openstacksdk/cinder_v2.py +++ /dev/null @@ -1,51 +0,0 @@ -# Copyright 2017 VMware, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import logging - -from vio.pub.vim.drivers import base -from vio.pub.vim.drivers.openstacksdk import sdk - -LOG = logging.getLogger(__name__) - -class CinderClient(base.DriverBase): - '''Cinder V2 driver.''' - - def __init__(self, params): - super(CinderClient, self).__init__(params) - LOG.info("%s", str(params)) - self.conn = sdk.create_connection(params) - self.session = self.conn.session - - @sdk.translate_exception - def list_volumes(self, **query): - volumes = self.conn.block_store.volumes(**query) - return volumes - - - @sdk.translate_exception - def create_volume(self, **body): - volume_info = self.conn.block_store.create_volume(**body) - return volume_info - - - @sdk.translate_exception - def delete_volume(self, volumeid): - self.conn.block_store.delete_volume(volumeid) - - - @sdk.translate_exception - def get_volume(self, volumeid): - volume_info = self.conn.block_store.get_volume(volumeid) - return volume_info diff --git a/vio/vio/pub/vim/drivers/openstacksdk/compute.py b/vio/vio/pub/vim/drivers/openstacksdk/compute.py deleted file mode 100644 index cfe9461..0000000 --- a/vio/vio/pub/vim/drivers/openstacksdk/compute.py +++ /dev/null @@ -1,95 +0,0 @@ -# Copyright (c) 2017 VMware, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -import base64 -import logging - -from vio.pub.vim.drivers import base -from vio.pub.vim.drivers.openstacksdk import sdk - -LOG = logging.getLogger(__name__) - - -class ComputeClient(base.DriverBase): - """Compute driver.""" - - def __init__(self, params): - super(ComputeClient, self).__init__(params) - self.conn = sdk.create_connection(params) - self.session = self.conn.session - - @sdk.translate_exception - def create_server(self, **kwargs): - server = self.conn.compute.create_server(**kwargs) - return server - - @sdk.translate_exception - def list_servers(self): - servers = self.conn.compute.servers() - return servers - - @sdk.translate_exception - def get_server(self, server_id, **query): - server = self.conn.compute.get_server(server=server_id) - return server - - @sdk.translate_exception - def delete_server(self, server_id, **query): - self.conn.compute.delete_server(server=server_id) - - @sdk.translate_exception - def list_server_interfaces(self, server_id): - ifaces = self.conn.compute.server_interfaces(server_id) - return list(ifaces) - - @sdk.translate_exception - def list_flavors(self, **query): - flavors = self.conn.compute.flavors() - return flavors - - @sdk.translate_exception - def create_flavor(self, **kwargs): - return self.conn.compute.create_flavor(**kwargs) - - @sdk.translate_exception - def get_flavor(self, flavor_id, **query): - return self.conn.compute.get_flavor(flavor=flavor_id) - - @sdk.translate_exception - def find_flavor(self, flavor_id): - return self.conn.compute.find_flavor(flavor_id, ignore_missing=False) - - @sdk.translate_exception - def delete_flavor(self, flavor_id, **query): - self.conn.compute.delete_flavor(flavor=flavor_id) - - @sdk.translate_exception - def get_flavor_extra_specs(self, flavor_id, **query): - return None - - @sdk.translate_exception - def find_image(self, image_id, ignore_missing=False): - return self.conn.compute.find_image( - image_id, ignore_missing=ignore_missing) - - @sdk.translate_exception - def get_limits(self, **kwargs): - return self.conn.compute.get_limits() - - @sdk.translate_exception - def list_services(self, **kwargs): - return self.conn.compute.services() - - @sdk.translate_exception - def get_hypervisor(self, hypervisor, **kwargs): - return self.conn.compute.get_hypervisor(hypervisor=hypervisor) diff --git a/vio/vio/pub/vim/drivers/openstacksdk/image_v2.py b/vio/vio/pub/vim/drivers/openstacksdk/image_v2.py deleted file mode 100644 index 79ccfba..0000000 --- a/vio/vio/pub/vim/drivers/openstacksdk/image_v2.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2017 VMware, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - - -import logging - -from vio.pub.vim.drivers import base -from vio.pub.vim.drivers.openstacksdk import sdk -from openstack.image.v2 import image as _image - -LOG = logging.getLogger(__name__) - - -class GlanceClient(base.DriverBase): - - def __init__(self, params): - super(GlanceClient, self).__init__(params) - LOG.info("%s", str(params)) - self.conn = sdk.create_connection(params) - self.session = self.conn.session - self._proxy = self.conn.image - - @sdk.translate_exception - def list_images(self, **query): - images = self._proxy.images(**query) - return images - - @sdk.translate_exception - def get_image(self, imageid): - image = self._proxy.get_image(imageid) - return image - - @sdk.translate_exception - def delete_image(self, imageid): - self._proxy.delete_image(imageid) - - @sdk.translate_exception - def create_image(self, **data): - - disk_format = data.pop('disk_format') - container_format = data.pop('container_format') - - if not all([container_format, disk_format]): - LOG.error( "Both container_format and disk_format are required") - - try: - img = self._proxy._create(_image.Image, disk_format=disk_format, - container_format=container_format, **data) - except Exception as ex: - pass - return img - - @sdk.translate_exception - def upload_image(self, data, image): - image.data = data - image.upload(self.session) \ No newline at end of file diff --git a/vio/vio/pub/vim/drivers/openstacksdk/keystone_v3.py b/vio/vio/pub/vim/drivers/openstacksdk/keystone_v3.py deleted file mode 100644 index 7628477..0000000 --- a/vio/vio/pub/vim/drivers/openstacksdk/keystone_v3.py +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2017 VMware, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -import logging - -from vio.pub.vim.drivers import base -from vio.pub.vim.drivers.openstacksdk import sdk - -LOG = logging.getLogger(__name__) - - -class KeystoneClient(base.DriverBase): - '''Keystone V3 driver.''' - - def __init__(self, params): - super(KeystoneClient, self).__init__(params) - self.conn = sdk.create_connection(params) - self.session = self.conn.session - - @sdk.translate_exception - def project_list(self): - projects = self.conn.identity.projects() - return projects diff --git a/vio/vio/pub/vim/drivers/openstacksdk/neutron_v2_0.py b/vio/vio/pub/vim/drivers/openstacksdk/neutron_v2_0.py deleted file mode 100644 index 6ab7535..0000000 --- a/vio/vio/pub/vim/drivers/openstacksdk/neutron_v2_0.py +++ /dev/null @@ -1,87 +0,0 @@ -# Copyright (c) 2017 VMware, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -from vio.pub.vim.drivers import base -from vio.pub.vim.drivers.openstacksdk import sdk - - -class NeutronClient(base.DriverBase): - '''Neutron V2.0 driver.''' - - def __init__(self, params): - super(NeutronClient, self).__init__(params) - self.conn = sdk.create_connection(params) - - @sdk.translate_exception - def subnet_create(self, **args): - network = self.conn.network.create_subnet(**args) - return network - - @sdk.translate_exception - def network_create(self, **args): - network = self.conn.network.create_network(**args) - return network - - @sdk.translate_exception - def network_get(self, name_or_id): - network = self.conn.network.find_network(name_or_id) - return network - - @sdk.translate_exception - def network_delete(self, name_or_id): - res = self.conn.network.delete_network(name_or_id) - return res - - @sdk.translate_exception - def networks_get(self, **kwargs): - network = self.conn.network.networks(**kwargs) - return network - - @sdk.translate_exception - def subnets_get(self, **kwargs): - subnets = self.conn.network.subnets(**kwargs) - return subnets - - @sdk.translate_exception - def subnet_delete(self, name_or_id): - res = self.conn.network.delete_subnet(name_or_id) - return res - - @sdk.translate_exception - def port_find(self, name_or_id, ignore_missing=False): - port = self.conn.network.find_port(name_or_id, ignore_missing) - return port - - @sdk.translate_exception - def subnet_get(self, name_or_id, ignore_missing=False): - subnet = self.conn.network.find_subnet(name_or_id, ignore_missing) - return subnet - - @sdk.translate_exception - def port_create(self, **attr): - res = self.conn.network.create_port(**attr) - return res - - @sdk.translate_exception - def port_delete(self, port, ignore_missing=True): - res = self.conn.network.delete_port( - port=port, ignore_missing=ignore_missing) - return res - - @sdk.translate_exception - def ports_get(self, **kwargs): - ports = self.conn.network.ports(**kwargs) - return ports - - diff --git a/vio/vio/pub/vim/drivers/openstacksdk/sdk.py b/vio/vio/pub/vim/drivers/openstacksdk/sdk.py deleted file mode 100644 index 9f01a4d..0000000 --- a/vio/vio/pub/vim/drivers/openstacksdk/sdk.py +++ /dev/null @@ -1,132 +0,0 @@ -# Copyright (c) 2017 VMware, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -''' -SDK Client -''' -import functools -import json -import logging -import six - -from openstack import connection -from openstack import exceptions as sdk_exc -from openstack import profile -from requests import exceptions as req_exc - - -USER_AGENT = 'vimdriver-vio' -exc = sdk_exc -LOG = logging.getLogger(__name__) - - -def parse_exception(ex): - '''Parse exception code and yield useful information.''' - code = 500 - - if isinstance(ex, sdk_exc.HttpException): - # some exceptions don't contain status_code - if ex.http_status is not None: - code = ex.http_status - message = ex.message - data = {} - if ex.details is None and ex.response is not None: - data = ex.response.json() - else: - try: - data = json.loads(ex.details) - except Exception: - # Some exceptions don't have details record or - # are not in JSON format - pass - - # try dig more into the exception record - # usually 'data' has two types of format : - # type1: {"forbidden": {"message": "error message", "code": 403} - # type2: {"code": 404, "error": { "message": "not found"}} - if data: - code = data.get('code', code) - message = data.get('message', message) - error = data.get('error', None) - if error: - code = data.get('code', code) - message = data['error'].get('message', message) - else: - for value in data.values(): - code = value.get('code', code) - message = value.get('message', message) - - elif isinstance(ex, sdk_exc.SDKException): - # Besides HttpException there are some other exceptions like - # ResourceTimeout can be raised from SDK, handle them here. - message = ex.message - elif isinstance(ex, req_exc.RequestException): - # Exceptions that are not captured by SDK - code = ex.errno - message = six.text_type(ex) - else: - # This could be a generic exception or something we don't understand - message = six.text_type(ex) - - import traceback - traceback.print_exc() - raise ex -# raise senlin_exc.InternalError(code=code, message=message) - - -def translate_exception(func): - """Decorator for exception translation.""" - - @functools.wraps(func) - def invoke_with_catch(driver, *args, **kwargs): - try: - return func(driver, *args, **kwargs) - except Exception as ex: - LOG.exception(ex) - raise parse_exception(ex) - - return invoke_with_catch - - -def create_connection(params=None): - if params is None: - params = {} - - auth_plugin = 'password' - - prof = profile.Profile() - prof.set_version('identity', 'v3') - prof.set_version('image', 'v2') - - try: - conn = connection.Connection(profile=prof, verify=False, user_agent=USER_AGENT, - auth_plugin=auth_plugin, **params) - except Exception as ex: - raise parse_exception(ex) - - return conn - - -def authenticate(**kwargs): - '''Authenticate using openstack sdk based on user credential''' - - conn = create_connection(kwargs) - access_info = { - 'token': conn.session.get_token(), - 'user_id': conn.session.get_user_id(), - 'project_id': conn.session.get_project_id() - } - - return access_info - diff --git a/vio/vio/pub/vim/drivers/vimdriver.py b/vio/vio/pub/vim/drivers/vimdriver.py index 3fb5bc0..807cc98 100644 --- a/vio/vio/pub/vim/drivers/vimdriver.py +++ b/vio/vio/pub/vim/drivers/vimdriver.py @@ -1,22 +1,20 @@ # Copyright (c) 2017 VMware, Inc. # -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -from vio.pub.vim.drivers.openstacksdk import image_v2 -from vio.pub.vim.drivers.openstacksdk import keystone_v3 -from vio.pub.vim.drivers.openstacksdk import cinder_v2 -from vio.pub.vim.drivers.openstacksdk import compute +from vio.pub.vim.drivers.vimsdk import image_v2 +from vio.pub.vim.drivers.vimsdk import keystone_v3 +from vio.pub.vim.drivers.vimsdk import cinder_v2 +from vio.pub.vim.drivers.vimsdk import compute class VimDriver(object): diff --git a/vio/vio/pub/vim/drivers/vimsdk/__init__.py b/vio/vio/pub/vim/drivers/vimsdk/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/vio/vio/pub/vim/drivers/vimsdk/cinder_v2.py b/vio/vio/pub/vim/drivers/vimsdk/cinder_v2.py new file mode 100644 index 0000000..c0c2db1 --- /dev/null +++ b/vio/vio/pub/vim/drivers/vimsdk/cinder_v2.py @@ -0,0 +1,49 @@ +# Copyright (c) 2017 VMware, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +import logging + +from vio.pub.vim.drivers import base +from vio.pub.vim.drivers.vimsdk import sdk + +LOG = logging.getLogger(__name__) + +class CinderClient(base.DriverBase): + '''Cinder V2 driver.''' + + def __init__(self, params): + super(CinderClient, self).__init__(params) + LOG.info("%s", str(params)) + self.conn = sdk.create_connection(params) + self.session = self.conn.session + + @sdk.translate_exception + def list_volumes(self, **query): + volumes = self.conn.block_store.volumes(**query) + return volumes + + + @sdk.translate_exception + def create_volume(self, **body): + volume_info = self.conn.block_store.create_volume(**body) + return volume_info + + + @sdk.translate_exception + def delete_volume(self, volumeid): + self.conn.block_store.delete_volume(volumeid) + + + @sdk.translate_exception + def get_volume(self, volumeid): + volume_info = self.conn.block_store.get_volume(volumeid) + return volume_info diff --git a/vio/vio/pub/vim/drivers/vimsdk/compute.py b/vio/vio/pub/vim/drivers/vimsdk/compute.py new file mode 100644 index 0000000..d336703 --- /dev/null +++ b/vio/vio/pub/vim/drivers/vimsdk/compute.py @@ -0,0 +1,94 @@ +# Copyright (c) 2017 VMware, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +import base64 +import logging + +from vio.pub.vim.drivers import base +from vio.pub.vim.drivers.vimsdk import sdk + +LOG = logging.getLogger(__name__) + + +class ComputeClient(base.DriverBase): + """Compute driver.""" + + def __init__(self, params): + super(ComputeClient, self).__init__(params) + self.conn = sdk.create_connection(params) + self.session = self.conn.session + + @sdk.translate_exception + def create_server(self, **kwargs): + server = self.conn.compute.create_server(**kwargs) + return server + + @sdk.translate_exception + def list_servers(self): + servers = self.conn.compute.servers() + return servers + + @sdk.translate_exception + def get_server(self, server_id, **query): + server = self.conn.compute.get_server(server=server_id) + return server + + @sdk.translate_exception + def delete_server(self, server_id, **query): + self.conn.compute.delete_server(server=server_id) + + @sdk.translate_exception + def list_server_interfaces(self, server_id): + ifaces = self.conn.compute.server_interfaces(server_id) + return list(ifaces) + + @sdk.translate_exception + def list_flavors(self, **query): + flavors = self.conn.compute.flavors() + return flavors + + @sdk.translate_exception + def create_flavor(self, **kwargs): + return self.conn.compute.create_flavor(**kwargs) + + @sdk.translate_exception + def get_flavor(self, flavor_id, **query): + return self.conn.compute.get_flavor(flavor=flavor_id) + + @sdk.translate_exception + def find_flavor(self, flavor_id): + return self.conn.compute.find_flavor(flavor_id, ignore_missing=False) + + @sdk.translate_exception + def delete_flavor(self, flavor_id, **query): + self.conn.compute.delete_flavor(flavor=flavor_id) + + @sdk.translate_exception + def get_flavor_extra_specs(self, flavor_id, **query): + return None + + @sdk.translate_exception + def find_image(self, image_id, ignore_missing=False): + return self.conn.compute.find_image( + image_id, ignore_missing=ignore_missing) + + @sdk.translate_exception + def get_limits(self, **kwargs): + return self.conn.compute.get_limits() + + @sdk.translate_exception + def list_services(self, **kwargs): + return self.conn.compute.services() + + @sdk.translate_exception + def get_hypervisor(self, hypervisor, **kwargs): + return self.conn.compute.get_hypervisor(hypervisor=hypervisor) diff --git a/vio/vio/pub/vim/drivers/vimsdk/image_v2.py b/vio/vio/pub/vim/drivers/vimsdk/image_v2.py new file mode 100644 index 0000000..ba2db47 --- /dev/null +++ b/vio/vio/pub/vim/drivers/vimsdk/image_v2.py @@ -0,0 +1,62 @@ +# Copyright (c) 2017 VMware, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + + +import logging + +from vio.pub.vim.drivers import base +from vio.pub.vim.drivers.vimsdk import sdk +from openstack.image.v2 import image as _image + +LOG = logging.getLogger(__name__) + + +class GlanceClient(base.DriverBase): + + def __init__(self, params): + super(GlanceClient, self).__init__(params) + LOG.info("%s", str(params)) + self.conn = sdk.create_connection(params) + self.session = self.conn.session + self._proxy = self.conn.image + + @sdk.translate_exception + def list_images(self, **query): + images = self._proxy.images(**query) + return images + + @sdk.translate_exception + def get_image(self, imageid): + image = self._proxy.get_image(imageid) + return image + + @sdk.translate_exception + def delete_image(self, imageid): + self._proxy.delete_image(imageid) + + @sdk.translate_exception + def create_image(self, **data): + + disk_format = data.pop('disk_format') + container_format = data.pop('container_format') + + if not all([container_format, disk_format]): + LOG.error( "Both container_format and disk_format are required") + + img = self._proxy._create(_image.Image, disk_format=disk_format, + container_format=container_format, **data) + return img + + @sdk.translate_exception + def upload_image(self, data, image): + image.data = data + image.upload(self.session) \ No newline at end of file diff --git a/vio/vio/pub/vim/drivers/vimsdk/keystone_v3.py b/vio/vio/pub/vim/drivers/vimsdk/keystone_v3.py new file mode 100644 index 0000000..aff2d6f --- /dev/null +++ b/vio/vio/pub/vim/drivers/vimsdk/keystone_v3.py @@ -0,0 +1,32 @@ +# Copyright (c) 2017 VMware, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +import logging + +from vio.pub.vim.drivers import base +from vio.pub.vim.drivers.vimsdk import sdk + +LOG = logging.getLogger(__name__) + + +class KeystoneClient(base.DriverBase): + '''Keystone V3 driver.''' + + def __init__(self, params): + super(KeystoneClient, self).__init__(params) + self.conn = sdk.create_connection(params) + self.session = self.conn.session + + @sdk.translate_exception + def project_list(self): + projects = self.conn.identity.projects() + return projects diff --git a/vio/vio/pub/vim/drivers/vimsdk/neutron_v2_0.py b/vio/vio/pub/vim/drivers/vimsdk/neutron_v2_0.py new file mode 100644 index 0000000..1446698 --- /dev/null +++ b/vio/vio/pub/vim/drivers/vimsdk/neutron_v2_0.py @@ -0,0 +1,85 @@ +# Copyright (c) 2017 VMware, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +from vio.pub.vim.drivers import base +from vio.pub.vim.drivers.vimsdk import sdk + + +class NeutronClient(base.DriverBase): + '''Neutron V2.0 driver.''' + + def __init__(self, params): + super(NeutronClient, self).__init__(params) + self.conn = sdk.create_connection(params) + + @sdk.translate_exception + def subnet_create(self, **args): + network = self.conn.network.create_subnet(**args) + return network + + @sdk.translate_exception + def network_create(self, **args): + network = self.conn.network.create_network(**args) + return network + + @sdk.translate_exception + def network_get(self, name_or_id): + network = self.conn.network.find_network(name_or_id) + return network + + @sdk.translate_exception + def network_delete(self, name_or_id): + res = self.conn.network.delete_network(name_or_id) + return res + + @sdk.translate_exception + def networks_get(self, **kwargs): + network = self.conn.network.networks(**kwargs) + return network + + @sdk.translate_exception + def subnets_get(self, **kwargs): + subnets = self.conn.network.subnets(**kwargs) + return subnets + + @sdk.translate_exception + def subnet_delete(self, name_or_id): + res = self.conn.network.delete_subnet(name_or_id) + return res + + @sdk.translate_exception + def port_find(self, name_or_id, ignore_missing=False): + port = self.conn.network.find_port(name_or_id, ignore_missing) + return port + + @sdk.translate_exception + def subnet_get(self, name_or_id, ignore_missing=False): + subnet = self.conn.network.find_subnet(name_or_id, ignore_missing) + return subnet + + @sdk.translate_exception + def port_create(self, **attr): + res = self.conn.network.create_port(**attr) + return res + + @sdk.translate_exception + def port_delete(self, port, ignore_missing=True): + res = self.conn.network.delete_port( + port=port, ignore_missing=ignore_missing) + return res + + @sdk.translate_exception + def ports_get(self, **kwargs): + ports = self.conn.network.ports(**kwargs) + return ports + + diff --git a/vio/vio/pub/vim/drivers/vimsdk/sdk.py b/vio/vio/pub/vim/drivers/vimsdk/sdk.py new file mode 100644 index 0000000..228ead8 --- /dev/null +++ b/vio/vio/pub/vim/drivers/vimsdk/sdk.py @@ -0,0 +1,130 @@ +# Copyright (c) 2017 VMware, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + +''' +SDK Client +''' +import functools +import json +import logging +import six + +from openstack import connection +from openstack import exceptions as sdk_exc +from openstack import profile +from requests import exceptions as req_exc + + +USER_AGENT = 'vimdriver-vio' +exc = sdk_exc +LOG = logging.getLogger(__name__) + + +def parse_exception(ex): + '''Parse exception code and yield useful information.''' + code = 500 + + if isinstance(ex, sdk_exc.HttpException): + # some exceptions don't contain status_code + if ex.http_status is not None: + code = ex.http_status + message = ex.message + data = {} + if ex.details is None and ex.response is not None: + data = ex.response.json() + else: + try: + data = json.loads(ex.details) + except Exception: + # Some exceptions don't have details record or + # are not in JSON format + pass + + # try dig more into the exception record + # usually 'data' has two types of format : + # type1: {"forbidden": {"message": "error message", "code": 403} + # type2: {"code": 404, "error": { "message": "not found"}} + if data: + code = data.get('code', code) + message = data.get('message', message) + error = data.get('error', None) + if error: + code = data.get('code', code) + message = data['error'].get('message', message) + else: + for value in data.values(): + code = value.get('code', code) + message = value.get('message', message) + + elif isinstance(ex, sdk_exc.SDKException): + # Besides HttpException there are some other exceptions like + # ResourceTimeout can be raised from SDK, handle them here. + message = ex.message + elif isinstance(ex, req_exc.RequestException): + # Exceptions that are not captured by SDK + code = ex.errno + message = six.text_type(ex) + else: + # This could be a generic exception or something we don't understand + message = six.text_type(ex) + + import traceback + traceback.print_exc() + raise ex +# raise senlin_exc.InternalError(code=code, message=message) + + +def translate_exception(func): + """Decorator for exception translation.""" + + @functools.wraps(func) + def invoke_with_catch(driver, *args, **kwargs): + try: + return func(driver, *args, **kwargs) + except Exception as ex: + LOG.exception(ex) + raise parse_exception(ex) + + return invoke_with_catch + + +def create_connection(params=None): + if params is None: + params = {} + + auth_plugin = 'password' + + prof = profile.Profile() + prof.set_version('identity', 'v3') + prof.set_version('image', 'v2') + + try: + conn = connection.Connection(profile=prof, verify=False, user_agent=USER_AGENT, + auth_plugin=auth_plugin, **params) + except Exception as ex: + raise parse_exception(ex) + + return conn + + +def authenticate(**kwargs): + '''Authenticate using openstack sdk based on user credential''' + + conn = create_connection(kwargs) + access_info = { + 'token': conn.session.get_token(), + 'user_id': conn.session.get_user_id(), + 'project_id': conn.session.get_project_id() + } + + return access_info + diff --git a/vio/vio/pub/vim/vimapi/baseclient.py b/vio/vio/pub/vim/vimapi/baseclient.py index 44b2739..796ce1b 100644 --- a/vio/vio/pub/vim/vimapi/baseclient.py +++ b/vio/vio/pub/vim/vimapi/baseclient.py @@ -1,14 +1,15 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at +# Copyright (c) 2017 VMware, Inc. # -# http://www.apache.org/licenses/LICENSE-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + import logging diff --git a/vio/vio/pub/vim/vimapi/cinder/OperateVolume.py b/vio/vio/pub/vim/vimapi/cinder/OperateVolume.py index 4458309..33224c3 100644 --- a/vio/vio/pub/vim/vimapi/cinder/OperateVolume.py +++ b/vio/vio/pub/vim/vimapi/cinder/OperateVolume.py @@ -1,16 +1,14 @@ -# Copyright 2017 VMware, Inc. +# Copyright (c) 2017 VMware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# You may obtain a copy of the License at: # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import logging diff --git a/vio/vio/pub/vim/vimapi/glance/OperateImage.py b/vio/vio/pub/vim/vimapi/glance/OperateImage.py index 446f808..74408f3 100644 --- a/vio/vio/pub/vim/vimapi/glance/OperateImage.py +++ b/vio/vio/pub/vim/vimapi/glance/OperateImage.py @@ -1,16 +1,14 @@ -# Copyright 2017 VMware, Inc. +# Copyright (c) 2017 VMware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# You may obtain a copy of the License at: # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. import logging @@ -93,8 +91,6 @@ class OperateImage(baseclient): running_thread_lock.acquire() running_threads[image.id] = image.id running_thread_lock.release() - try: - upload_image_thread.start() - except Exception as ex: - pass + + upload_image_thread.start() return image \ No newline at end of file diff --git a/vio/vio/pub/vim/vimapi/keystone/OperateTenant.py b/vio/vio/pub/vim/vimapi/keystone/OperateTenant.py index 31e1752..a60cf46 100644 --- a/vio/vio/pub/vim/vimapi/keystone/OperateTenant.py +++ b/vio/vio/pub/vim/vimapi/keystone/OperateTenant.py @@ -1,16 +1,15 @@ -# Copyright 2016 ZTE Corporation. +# Copyright (c) 2017 VMware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# You may obtain a copy of the License at: # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. + import logging diff --git a/vio/vio/pub/vim/vimapi/keystone/auth.py b/vio/vio/pub/vim/vimapi/keystone/auth.py index 86f03c2..bacfad6 100644 --- a/vio/vio/pub/vim/vimapi/keystone/auth.py +++ b/vio/vio/pub/vim/vimapi/keystone/auth.py @@ -1,16 +1,15 @@ -# Copyright 2016 ZTE Corporation. +# Copyright (c) 2017 VMware, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# You may obtain a copy of the License at: # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. + import logging diff --git a/vio/vio/pub/vim/vimapi/network/OperateNetwork.py b/vio/vio/pub/vim/vimapi/network/OperateNetwork.py index 848878e..18adf1b 100644 --- a/vio/vio/pub/vim/vimapi/network/OperateNetwork.py +++ b/vio/vio/pub/vim/vimapi/network/OperateNetwork.py @@ -1,18 +1,19 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at +# Copyright (c) 2017 VMware, Inc. # -# http://www.apache.org/licenses/LICENSE-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + import logging from vio.pub.msapi.extsys import get_vim_by_id -from vio.pub.vim.drivers.openstacksdk import neutron_v2_0 +from vio.pub.vim.drivers.vimsdk import neutron_v2_0 logger = logging.getLogger(__name__) diff --git a/vio/vio/pub/vim/vimapi/network/OperatePort.py b/vio/vio/pub/vim/vimapi/network/OperatePort.py index 4ed0112..5e98623 100644 --- a/vio/vio/pub/vim/vimapi/network/OperatePort.py +++ b/vio/vio/pub/vim/vimapi/network/OperatePort.py @@ -1,18 +1,19 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at +# Copyright (c) 2017 VMware, Inc. # -# http://www.apache.org/licenses/LICENSE-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + import logging from vio.pub.msapi.extsys import get_vim_by_id -from vio.pub.vim.drivers.openstacksdk import neutron_v2_0 +from vio.pub.vim.drivers.vimsdk import neutron_v2_0 from vio.pub.vim.vimapi.network.OperateNetwork import BaseNet, translate diff --git a/vio/vio/pub/vim/vimapi/network/OperateSubnet.py b/vio/vio/pub/vim/vimapi/network/OperateSubnet.py index b9b4c27..f697d2c 100644 --- a/vio/vio/pub/vim/vimapi/network/OperateSubnet.py +++ b/vio/vio/pub/vim/vimapi/network/OperateSubnet.py @@ -1,18 +1,19 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); you may -# not use this file except in compliance with the License. You may obtain -# a copy of the License at +# Copyright (c) 2017 VMware, Inc. # -# http://www.apache.org/licenses/LICENSE-2.0 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at: +# +# http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + import logging from vio.pub.msapi.extsys import get_vim_by_id -from vio.pub.vim.drivers.openstacksdk import neutron_v2_0 +from vio.pub.vim.drivers.vimsdk import neutron_v2_0 from vio.pub.vim.vimapi.network.OperateNetwork import BaseNet,translate diff --git a/vio/vio/pub/vim/vimapi/nova/OperateFlavors.py b/vio/vio/pub/vim/vimapi/nova/OperateFlavors.py index 92dfbbf..6341845 100644 --- a/vio/vio/pub/vim/vimapi/nova/OperateFlavors.py +++ b/vio/vio/pub/vim/vimapi/nova/OperateFlavors.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/vim/vimapi/nova/OperateHypervisor.py b/vio/vio/pub/vim/vimapi/nova/OperateHypervisor.py index 8b3de91..f6a1921 100644 --- a/vio/vio/pub/vim/vimapi/nova/OperateHypervisor.py +++ b/vio/vio/pub/vim/vimapi/nova/OperateHypervisor.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/vim/vimapi/nova/OperateLimits.py b/vio/vio/pub/vim/vimapi/nova/OperateLimits.py index 34e0584..6854f60 100644 --- a/vio/vio/pub/vim/vimapi/nova/OperateLimits.py +++ b/vio/vio/pub/vim/vimapi/nova/OperateLimits.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/vim/vimapi/nova/OperateNova.py b/vio/vio/pub/vim/vimapi/nova/OperateNova.py index 49461a2..0bb6db0 100644 --- a/vio/vio/pub/vim/vimapi/nova/OperateNova.py +++ b/vio/vio/pub/vim/vimapi/nova/OperateNova.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/vim/vimapi/nova/OperateServers.py b/vio/vio/pub/vim/vimapi/nova/OperateServers.py index eb44eb8..1a9972b 100644 --- a/vio/vio/pub/vim/vimapi/nova/OperateServers.py +++ b/vio/vio/pub/vim/vimapi/nova/OperateServers.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/vim/vimapi/nova/OperateService.py b/vio/vio/pub/vim/vimapi/nova/OperateService.py index d29779a..f1b0156 100644 --- a/vio/vio/pub/vim/vimapi/nova/OperateService.py +++ b/vio/vio/pub/vim/vimapi/nova/OperateService.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/pub/vim/vimapi/nova/__init__.py b/vio/vio/pub/vim/vimapi/nova/__init__.py index 8770c43..de022ef 100644 --- a/vio/vio/pub/vim/vimapi/nova/__init__.py +++ b/vio/vio/pub/vim/vimapi/nova/__init__.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/samples/__init__.py b/vio/vio/samples/__init__.py index a8fe66a..12fa1e8 100644 --- a/vio/vio/samples/__init__.py +++ b/vio/vio/samples/__init__.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/samples/tests.py b/vio/vio/samples/tests.py index a3dbf4b..d0fcd3f 100644 --- a/vio/vio/samples/tests.py +++ b/vio/vio/samples/tests.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/samples/urls.py b/vio/vio/samples/urls.py index 0e7ba4c..bba5529 100644 --- a/vio/vio/samples/urls.py +++ b/vio/vio/samples/urls.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/samples/views.py b/vio/vio/samples/views.py index a2ba070..fff6f39 100644 --- a/vio/vio/samples/views.py +++ b/vio/vio/samples/views.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/settings.py b/vio/vio/settings.py index 9a95094..f506872 100644 --- a/vio/vio/settings.py +++ b/vio/vio/settings.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/__init__.py b/vio/vio/swagger/__init__.py index a8fe66a..12fa1e8 100644 --- a/vio/vio/swagger/__init__.py +++ b/vio/vio/swagger/__init__.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/image_utils.py b/vio/vio/swagger/image_utils.py index 6380688..f31e76c 100644 --- a/vio/vio/swagger/image_utils.py +++ b/vio/vio/swagger/image_utils.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/nova_utils.py b/vio/vio/swagger/nova_utils.py index 6084317..922a49d 100644 --- a/vio/vio/swagger/nova_utils.py +++ b/vio/vio/swagger/nova_utils.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/tests.py b/vio/vio/swagger/tests.py index e29efbd..04b4236 100644 --- a/vio/vio/swagger/tests.py +++ b/vio/vio/swagger/tests.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/urls.py b/vio/vio/swagger/urls.py index c058df0..1740c03 100644 --- a/vio/vio/swagger/urls.py +++ b/vio/vio/swagger/urls.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views.py b/vio/vio/swagger/views.py index 630d965..eced70b 100644 --- a/vio/vio/swagger/views.py +++ b/vio/vio/swagger/views.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views/__init__.py b/vio/vio/swagger/views/__init__.py index a8fe66a..12fa1e8 100644 --- a/vio/vio/swagger/views/__init__.py +++ b/vio/vio/swagger/views/__init__.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views/flavor/__init__.py b/vio/vio/swagger/views/flavor/__init__.py index a8fe66a..12fa1e8 100644 --- a/vio/vio/swagger/views/flavor/__init__.py +++ b/vio/vio/swagger/views/flavor/__init__.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views/flavor/views.py b/vio/vio/swagger/views/flavor/views.py index ec22c65..0d46dd7 100644 --- a/vio/vio/swagger/views/flavor/views.py +++ b/vio/vio/swagger/views/flavor/views.py @@ -3,12 +3,13 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + import json from rest_framework import status diff --git a/vio/vio/swagger/views/hypervisor/views.py b/vio/vio/swagger/views/hypervisor/views.py index 9019047..0df9dc9 100644 --- a/vio/vio/swagger/views/hypervisor/views.py +++ b/vio/vio/swagger/views/hypervisor/views.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views/image/__init__.py b/vio/vio/swagger/views/image/__init__.py index a8fe66a..12fa1e8 100644 --- a/vio/vio/swagger/views/image/__init__.py +++ b/vio/vio/swagger/views/image/__init__.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views/image/views.py b/vio/vio/swagger/views/image/views.py index 7d909f3..e57b4f2 100644 --- a/vio/vio/swagger/views/image/views.py +++ b/vio/vio/swagger/views/image/views.py @@ -3,13 +3,14 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +import json from rest_framework import status from rest_framework.response import Response diff --git a/vio/vio/swagger/views/limits/views.py b/vio/vio/swagger/views/limits/views.py index 5122223..4e4e607 100644 --- a/vio/vio/swagger/views/limits/views.py +++ b/vio/vio/swagger/views/limits/views.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views/network/views.py b/vio/vio/swagger/views/network/views.py index cb7adfe..b15b922 100644 --- a/vio/vio/swagger/views/network/views.py +++ b/vio/vio/swagger/views/network/views.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views/port/views.py b/vio/vio/swagger/views/port/views.py index 9a4af3f..7d9d56e 100644 --- a/vio/vio/swagger/views/port/views.py +++ b/vio/vio/swagger/views/port/views.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views/server/__init__.py b/vio/vio/swagger/views/server/__init__.py index a8fe66a..12fa1e8 100644 --- a/vio/vio/swagger/views/server/__init__.py +++ b/vio/vio/swagger/views/server/__init__.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views/server/views.py b/vio/vio/swagger/views/server/views.py index 3348754..785208d 100644 --- a/vio/vio/swagger/views/server/views.py +++ b/vio/vio/swagger/views/server/views.py @@ -3,12 +3,13 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + import json import logging diff --git a/vio/vio/swagger/views/service/views.py b/vio/vio/swagger/views/service/views.py index 535f2d2..cdc8103 100644 --- a/vio/vio/swagger/views/service/views.py +++ b/vio/vio/swagger/views/service/views.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views/subnet/views.py b/vio/vio/swagger/views/subnet/views.py index f95da54..9678627 100644 --- a/vio/vio/swagger/views/subnet/views.py +++ b/vio/vio/swagger/views/subnet/views.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views/swagger_json.py b/vio/vio/swagger/views/swagger_json.py index cf401b5..546f95e 100644 --- a/vio/vio/swagger/views/swagger_json.py +++ b/vio/vio/swagger/views/swagger_json.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views/tenant/__init__.py b/vio/vio/swagger/views/tenant/__init__.py index a8fe66a..12fa1e8 100644 --- a/vio/vio/swagger/views/tenant/__init__.py +++ b/vio/vio/swagger/views/tenant/__init__.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views/tenant/views.py b/vio/vio/swagger/views/tenant/views.py index 13bce23..44f175d 100644 --- a/vio/vio/swagger/views/tenant/views.py +++ b/vio/vio/swagger/views/tenant/views.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views/volume/__init__.py b/vio/vio/swagger/views/volume/__init__.py index a8fe66a..12fa1e8 100644 --- a/vio/vio/swagger/views/volume/__init__.py +++ b/vio/vio/swagger/views/volume/__init__.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/views/volume/views.py b/vio/vio/swagger/views/volume/views.py index 91f79f0..86ed2c7 100644 --- a/vio/vio/swagger/views/volume/views.py +++ b/vio/vio/swagger/views/volume/views.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/swagger/volume_utils.py b/vio/vio/swagger/volume_utils.py index 562a381..88d811b 100644 --- a/vio/vio/swagger/volume_utils.py +++ b/vio/vio/swagger/volume_utils.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/urls.py b/vio/vio/urls.py index bab793d..ab5e952 100644 --- a/vio/vio/urls.py +++ b/vio/vio/urls.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software diff --git a/vio/vio/wsgi.py b/vio/vio/wsgi.py index eb516e7..cebb8cb 100644 --- a/vio/vio/wsgi.py +++ b/vio/vio/wsgi.py @@ -3,7 +3,7 @@ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at: - +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software -- cgit 1.2.3-korg