From 026709bce61ab603591b7fea1b38a0cf47f630c3 Mon Sep 17 00:00:00 2001 From: Zhijiang Hu Date: Mon, 21 Aug 2017 23:37:33 -0400 Subject: [PATCH] Deal with new flake8 error Change-Id: I2d0f2c289a30ca7417b28f91b86958977128d944 Signed-off-by: Zhijiang Hu --- .../openstack/common/apiclient/utils.py | 12 +- .../daisyclient/v1/backend_types.py | 86 ++-- .../daisyclient/v1/deploy_server.py | 464 +++++++++--------- .../daisyclient/v1/param_helper.py | 172 +++---- code/daisyclient/daisyclient/v1/shell.py | 4 +- code/daisyclient/tox.ini | 2 +- code/horizon/openstack_dashboard/api/daisy.py | 20 +- .../dashboards/director_theme/__init__.py | 1 - .../dashboards/director_theme/models.py | 1 - .../environment/cluster/create_cluster.py | 18 +- .../environment/cluster/modify_cluster.py | 17 +- .../environment/cluster/net_plane.py | 18 +- .../dashboards/environment/cluster/role.py | 18 +- .../dashboards/environment/cluster/views.py | 18 +- .../dashboards/environment/configure/views.py | 17 +- .../environment/deploy/bonding_views.py | 19 +- .../environment/deploy/deploy_rule_lib.py | 23 +- .../environment/deploy/hosts_config_views.py | 20 +- .../deploy/hosts_role_assignment_views.py | 19 +- .../deploy/network_mapping_views.py | 19 +- .../environment/deploy/os_config_views.py | 17 +- .../environment/deploy/select_host_views.py | 18 + .../dashboards/environment/deploy/tables.py | 18 + .../dashboards/environment/deploy/views.py | 17 +- .../dashboards/environment/healthy/views.py | 17 +- .../dashboards/environment/host/views.py | 18 + .../dashboards/environment/overview/views.py | 18 + .../environment/overview/workflow.py | 18 + .../environment/system/system_config_views.py | 18 + .../dashboards/environment/system/views.py | 17 +- .../dashboards/environment/template/views.py | 17 +- .../dashboards/environment/version/views.py | 17 +- code/horizon/tox.ini | 9 +- test/tempest/tox.ini | 11 + tools/daisy-compile-rpm.sh | 3 +- 35 files changed, 776 insertions(+), 425 deletions(-) diff --git a/code/daisyclient/daisyclient/openstack/common/apiclient/utils.py b/code/daisyclient/daisyclient/openstack/common/apiclient/utils.py index f259c579..da44c20f 100755 --- a/code/daisyclient/daisyclient/openstack/common/apiclient/utils.py +++ b/code/daisyclient/daisyclient/openstack/common/apiclient/utils.py @@ -87,16 +87,12 @@ def find_resource(manager, name_or_id, **find_args): except exceptions.NotFound: msg = _("No %(name)s with a name or " "ID of '%(name_or_id)s' exists.") % \ - { - "name": manager.resource_class.__name__.lower(), - "name_or_id": name_or_id - } + {"name": manager.resource_class.__name__.lower(), + "name_or_id": name_or_id} raise exceptions.CommandError(msg) except exceptions.NoUniqueMatch: msg = _("Multiple %(name)s matches found for " "'%(name_or_id)s', use an ID to be more specific.") % \ - { - "name": manager.resource_class.__name__.lower(), - "name_or_id": name_or_id - } + {"name": manager.resource_class.__name__.lower(), + "name_or_id": name_or_id} raise exceptions.CommandError(msg) diff --git a/code/daisyclient/daisyclient/v1/backend_types.py b/code/daisyclient/daisyclient/v1/backend_types.py index 96223e26..4279e7b2 100644 --- a/code/daisyclient/daisyclient/v1/backend_types.py +++ b/code/daisyclient/daisyclient/v1/backend_types.py @@ -1,43 +1,43 @@ -# Copyright 2012 OpenStack Foundation -# All Rights Reserved. -# -# 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 copy -import six - -from daisyclient.common import utils -from daisyclient.openstack.common.apiclient import base - -BACKEND_TYPES_PARAMS = () -OS_REQ_ID_HDR = 'x-openstack-request-id' - - -class BackendTypes(base.Resource): - def __repr__(self): - return "" % self._info - - -class BackendTypesManager(base.ManagerWithFind): - resource_class = BackendTypes - - def list(self, **kwargs): - pass - - def get(self): - """ - get backend types - """ - url = '/v1/backend_types' - resp, body = self.client.post(url, headers=None, data=None) - return BackendTypes(self, body) +# Copyright 2012 OpenStack Foundation +# All Rights Reserved. +# +# 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 copy +import six + +from daisyclient.common import utils +from daisyclient.openstack.common.apiclient import base + +BACKEND_TYPES_PARAMS = () +OS_REQ_ID_HDR = 'x-openstack-request-id' + + +class BackendTypes(base.Resource): + def __repr__(self): + return "" % self._info + + +class BackendTypesManager(base.ManagerWithFind): + resource_class = BackendTypes + + def list(self, **kwargs): + pass + + def get(self): + """ + get backend types + """ + url = '/v1/backend_types' + resp, body = self.client.post(url, headers=None, data=None) + return BackendTypes(self, body) diff --git a/code/daisyclient/daisyclient/v1/deploy_server.py b/code/daisyclient/daisyclient/v1/deploy_server.py index 170c3406..f4bd9c1a 100755 --- a/code/daisyclient/daisyclient/v1/deploy_server.py +++ b/code/daisyclient/daisyclient/v1/deploy_server.py @@ -1,232 +1,232 @@ -# Copyright 2012 OpenStack Foundation -# All Rights Reserved. -# -# 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 copy - -from oslo_utils import encodeutils -from oslo_utils import strutils -import six -import six.moves.urllib.parse as urlparse - -from daisyclient.common import utils -from daisyclient.openstack.common.apiclient import base - -PXE_ENV_CHECK_PARAMS = ('deployment_interface', 'server_ip') - -DEFAULT_PAGE_SIZE = 200 - -SORT_DIR_VALUES = ('asc', 'desc') -SORT_KEY_VALUES = ('id', 'created_at', 'updated_at') - -OS_REQ_ID_HDR = 'x-openstack-request-id' - - -class DeployServer(base.Resource): - def __repr__(self): - return "" % self._info - - def update(self, **fields): - self.manager.update(self, **fields) - - def delete(self, **kwargs): - return self.manager.delete(self) - - def data(self, **kwargs): - return self.manager.data(self, **kwargs) - - -class DeployServerManager(base.ManagerWithFind): - resource_class = DeployServer - - def _deploy_server_meta_to_headers(self, fields): - headers = {} - fields_copy = copy.deepcopy(fields) - - # NOTE(flaper87): Convert to str, headers - # that are not instance of basestring. All - # headers will be encoded later, before the - # request is sent. - - for key, value in six.iteritems(fields_copy): - headers['%s' % key] = utils.to_str(value) - return headers - - @staticmethod - def _format_deploy_server_meta_for_user(meta): - for key in ['size', 'min_ram', 'min_disk']: - if key in meta: - try: - meta[key] = int(meta[key]) if meta[key] else 0 - except ValueError: - pass - return meta - - def _list(self, url, response_key, obj_class=None, body=None): - resp, body = self.client.get(url) - - if obj_class is None: - obj_class = self.resource_class - - data = body[response_key] - return ([obj_class(self, res, loaded=True) for res in data if res], - resp) - - def _build_params(self, parameters): - params = {'limit': parameters.get('page_size', DEFAULT_PAGE_SIZE)} - - if 'marker' in parameters: - params['marker'] = parameters['marker'] - - sort_key = parameters.get('sort_key') - if sort_key is not None: - if sort_key in SORT_KEY_VALUES: - params['sort_key'] = sort_key - else: - raise ValueError('sort_key must be one of the following: %s.' - % ', '.join(SORT_KEY_VALUES)) - - sort_dir = parameters.get('sort_dir') - if sort_dir is not None: - if sort_dir in SORT_DIR_VALUES: - params['sort_dir'] = sort_dir - else: - raise ValueError('sort_dir must be one of the following: %s.' - % ', '.join(SORT_DIR_VALUES)) - - filters = parameters.get('filters', {}) - params.update(filters) - - return params - - def get(self, id): - """get deploy server information by id.""" - pass - - def list(self, **kwargs): - """Get a list of deploy server. - - :param page_size: number of items to request in each paginated request - :param limit: maximum number of services to return - :param marker: begin returning services that appear later in the - service ist than that represented by this service id - :param filters: dict of direct comparison filters that mimics the - structure of an service object - :param return_request_id: If an empty list is provided, populate this - list with the request ID value from the header - x-openstack-request-id - :rtype: list of :class:`DeployServer` - """ - absolute_limit = kwargs.get('limit') - page_size = kwargs.get('page_size', DEFAULT_PAGE_SIZE) - - def paginate(qp, return_request_id=None): - for param, value in six.iteritems(qp): - if isinstance(value, six.string_types): - # Note(flaper87) Url encoding should - # be moved inside http utils, at least - # shouldn't be here. - # - # Making sure all params are str before - # trying to encode them - qp[param] = encodeutils.safe_decode(value) - url = '/v1/deploy_server?%s' % urlparse.urlencode(qp) - deploy_servers, resp = self._list(url, "deploy_servers") - - if return_request_id is not None: - return_request_id.append(resp.headers.get(OS_REQ_ID_HDR, None)) - - for deploy_server in deploy_servers: - yield deploy_server - - return_request_id = kwargs.get('return_req_id', None) - - params = self._build_params(kwargs) - - seen = 0 - while True: - seen_last_page = 0 - filtered = 0 - for deploy_server in paginate(params, return_request_id): - last_deploy_server = deploy_server.id - - if (absolute_limit is not None and - seen + seen_last_page >= absolute_limit): - # Note(kragniz): we've seen enough images - return - else: - seen_last_page += 1 - yield deploy_server - - seen += seen_last_page - - if seen_last_page + filtered == 0: - """ - Note(kragniz): we didn't get any deploy_servers - in the last page - """ - return - - if absolute_limit is not None and seen >= absolute_limit: - # Note(kragniz): reached the limit of deploy_servers to return - return - - if page_size and seen_last_page + filtered < page_size: - """ - Note(kragniz): we've reached the last page - of the deploy_servers - """ - return - - # Note(kragniz): there are more deploy_servers to come - params['marker'] = last_deploy_server - seen_last_page = 0 - - def add(self, **kwargs): - """Add . - - TODO(bcwaldon): document accepted params - """ - pass - - def delete(self, id): - """Delete.""" - pass - - def update(self, id, **kwargs): - """Update""" - pass - - def pxe_env_check(self, **kwargs): - """pxe env check - - TODO(bcwaldon): document accepted params - """ - fields = {} - for field in kwargs: - if field in PXE_ENV_CHECK_PARAMS: - fields[field] = kwargs[field] - elif field == 'return_req_id': - continue - else: - msg = "pxe_env_check() got an unexpected "\ - "keyword argument '%s'" - raise TypeError(msg % field) - - url = '/v1/deploy_servers/pxe_env_check' - resp, body = self.client.post(url, headers=None, data=fields) - - return DeployServer( - self, self._format_deploy_server_meta_for_user( - body['deploy_server_meta'])) +# Copyright 2012 OpenStack Foundation +# All Rights Reserved. +# +# 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 copy + +from oslo_utils import encodeutils +from oslo_utils import strutils +import six +import six.moves.urllib.parse as urlparse + +from daisyclient.common import utils +from daisyclient.openstack.common.apiclient import base + +PXE_ENV_CHECK_PARAMS = ('deployment_interface', 'server_ip') + +DEFAULT_PAGE_SIZE = 200 + +SORT_DIR_VALUES = ('asc', 'desc') +SORT_KEY_VALUES = ('id', 'created_at', 'updated_at') + +OS_REQ_ID_HDR = 'x-openstack-request-id' + + +class DeployServer(base.Resource): + def __repr__(self): + return "" % self._info + + def update(self, **fields): + self.manager.update(self, **fields) + + def delete(self, **kwargs): + return self.manager.delete(self) + + def data(self, **kwargs): + return self.manager.data(self, **kwargs) + + +class DeployServerManager(base.ManagerWithFind): + resource_class = DeployServer + + def _deploy_server_meta_to_headers(self, fields): + headers = {} + fields_copy = copy.deepcopy(fields) + + # NOTE(flaper87): Convert to str, headers + # that are not instance of basestring. All + # headers will be encoded later, before the + # request is sent. + + for key, value in six.iteritems(fields_copy): + headers['%s' % key] = utils.to_str(value) + return headers + + @staticmethod + def _format_deploy_server_meta_for_user(meta): + for key in ['size', 'min_ram', 'min_disk']: + if key in meta: + try: + meta[key] = int(meta[key]) if meta[key] else 0 + except ValueError: + pass + return meta + + def _list(self, url, response_key, obj_class=None, body=None): + resp, body = self.client.get(url) + + if obj_class is None: + obj_class = self.resource_class + + data = body[response_key] + return ([obj_class(self, res, loaded=True) for res in data if res], + resp) + + def _build_params(self, parameters): + params = {'limit': parameters.get('page_size', DEFAULT_PAGE_SIZE)} + + if 'marker' in parameters: + params['marker'] = parameters['marker'] + + sort_key = parameters.get('sort_key') + if sort_key is not None: + if sort_key in SORT_KEY_VALUES: + params['sort_key'] = sort_key + else: + raise ValueError('sort_key must be one of the following: %s.' + % ', '.join(SORT_KEY_VALUES)) + + sort_dir = parameters.get('sort_dir') + if sort_dir is not None: + if sort_dir in SORT_DIR_VALUES: + params['sort_dir'] = sort_dir + else: + raise ValueError('sort_dir must be one of the following: %s.' + % ', '.join(SORT_DIR_VALUES)) + + filters = parameters.get('filters', {}) + params.update(filters) + + return params + + def get(self, id): + """get deploy server information by id.""" + pass + + def list(self, **kwargs): + """Get a list of deploy server. + + :param page_size: number of items to request in each paginated request + :param limit: maximum number of services to return + :param marker: begin returning services that appear later in the + service ist than that represented by this service id + :param filters: dict of direct comparison filters that mimics the + structure of an service object + :param return_request_id: If an empty list is provided, populate this + list with the request ID value from the header + x-openstack-request-id + :rtype: list of :class:`DeployServer` + """ + absolute_limit = kwargs.get('limit') + page_size = kwargs.get('page_size', DEFAULT_PAGE_SIZE) + + def paginate(qp, return_request_id=None): + for param, value in six.iteritems(qp): + if isinstance(value, six.string_types): + # Note(flaper87) Url encoding should + # be moved inside http utils, at least + # shouldn't be here. + # + # Making sure all params are str before + # trying to encode them + qp[param] = encodeutils.safe_decode(value) + url = '/v1/deploy_server?%s' % urlparse.urlencode(qp) + deploy_servers, resp = self._list(url, "deploy_servers") + + if return_request_id is not None: + return_request_id.append(resp.headers.get(OS_REQ_ID_HDR, None)) + + for deploy_server in deploy_servers: + yield deploy_server + + return_request_id = kwargs.get('return_req_id', None) + + params = self._build_params(kwargs) + + seen = 0 + while True: + seen_last_page = 0 + filtered = 0 + for deploy_server in paginate(params, return_request_id): + last_deploy_server = deploy_server.id + + if (absolute_limit is not None and + seen + seen_last_page >= absolute_limit): + # Note(kragniz): we've seen enough images + return + else: + seen_last_page += 1 + yield deploy_server + + seen += seen_last_page + + if seen_last_page + filtered == 0: + """ + Note(kragniz): we didn't get any deploy_servers + in the last page + """ + return + + if absolute_limit is not None and seen >= absolute_limit: + # Note(kragniz): reached the limit of deploy_servers to return + return + + if page_size and seen_last_page + filtered < page_size: + """ + Note(kragniz): we've reached the last page + of the deploy_servers + """ + return + + # Note(kragniz): there are more deploy_servers to come + params['marker'] = last_deploy_server + seen_last_page = 0 + + def add(self, **kwargs): + """Add . + + TODO(bcwaldon): document accepted params + """ + pass + + def delete(self, id): + """Delete.""" + pass + + def update(self, id, **kwargs): + """Update""" + pass + + def pxe_env_check(self, **kwargs): + """pxe env check + + TODO(bcwaldon): document accepted params + """ + fields = {} + for field in kwargs: + if field in PXE_ENV_CHECK_PARAMS: + fields[field] = kwargs[field] + elif field == 'return_req_id': + continue + else: + msg = "pxe_env_check() got an unexpected "\ + "keyword argument '%s'" + raise TypeError(msg % field) + + url = '/v1/deploy_servers/pxe_env_check' + resp, body = self.client.post(url, headers=None, data=fields) + + return DeployServer( + self, self._format_deploy_server_meta_for_user( + body['deploy_server_meta'])) diff --git a/code/daisyclient/daisyclient/v1/param_helper.py b/code/daisyclient/daisyclient/v1/param_helper.py index 89906cb7..4ccbaad4 100755 --- a/code/daisyclient/daisyclient/v1/param_helper.py +++ b/code/daisyclient/daisyclient/v1/param_helper.py @@ -1,86 +1,86 @@ -# Copyright 2012 OpenStack Foundation -# All Rights Reserved. -# -# 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. - -# -*- coding:utf-8 -*- - -import os - - -def _read_template_file(args): - template_file = args.params_file_path - if not os.path.exists(template_file): - print("Params_file not exist or permission deiny.") - return - with open(template_file) as tfp: - params = ''.join( - tfp.read().replace("\\'", "").split(" ")).replace("\n", "") - return dict(eval(params)) - -CLUSTER_ADD_PARAMS_FILE = { - 'description': 'desc', - 'name': "test", - 'routers': [{ - 'description': 'router1', - 'external_logic_network': 'flat1', - 'name': 'router1', - 'subnets': ['subnet2', 'subnet10']}], - 'networks': [], - 'nodes': [], - 'logic_networks': [{ - 'name': 'internal1', - 'physnet_name': 'PRIVATE1', - 'segmentation_id': 200, - 'segmentation_type': 'vlan', - 'shared': True, - 'subnets': [{'cidr': '192.168.1.0/24', - 'dns_nameservers': ['8.8.4.4', - '8.8.8.8'], - 'floating_ranges': [['192.168.1.2', - '192.168.1.200']], - 'gateway': '192.168.1.1', - 'name': 'subnet2'}, - {'cidr': '172.16.1.0/24', - 'dns_nameservers': ['8.8.4.4', - '8.8.8.8'], - 'floating_ranges': [['172.16.1.130', - '172.16.1.150'], - ['172.16.1.151', - '172.16.1.254']], - 'gateway': '172.16.1.1', - 'name': 'subnet10'}], - 'type': 'internal'}, - {'name': 'flat1', - 'physnet_name': 'physnet1', - 'segmentation_type': 'flat', - 'segmentation_id': -1, - 'shared': True, - 'subnets': [{'cidr': '192.168.2.0/24', - 'dns_nameservers': ['8.8.4.4', - '8.8.8.8'], - 'floating_ranges': [['192.168.2.130', - '192.168.2.254']], - 'gateway': '192.168.2.1', - 'name': 'subnet123'}], - 'type': 'external'} - ], - 'networking_parameters': { - 'base_mac': 'fa:16:3e:00:00:00', - 'gre_id_range': [2, 4094], - 'net_l23_provider': 'ovs', - 'public_vip': '172.16.0.3', - 'segmentation_type': 'vlan,flat,vxlan,gre', - 'vlan_range': [2, 4094], - 'vni_range': [2, 4094]} -} +# Copyright 2012 OpenStack Foundation +# All Rights Reserved. +# +# 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. + +# -*- coding:utf-8 -*- + +import os + + +def _read_template_file(args): + template_file = args.params_file_path + if not os.path.exists(template_file): + print("Params_file not exist or permission deiny.") + return + with open(template_file) as tfp: + params = ''.join( + tfp.read().replace("\\'", "").split(" ")).replace("\n", "") + return dict(eval(params)) + +CLUSTER_ADD_PARAMS_FILE = { + 'description': 'desc', + 'name': "test", + 'routers': [{ + 'description': 'router1', + 'external_logic_network': 'flat1', + 'name': 'router1', + 'subnets': ['subnet2', 'subnet10']}], + 'networks': [], + 'nodes': [], + 'logic_networks': [{ + 'name': 'internal1', + 'physnet_name': 'PRIVATE1', + 'segmentation_id': 200, + 'segmentation_type': 'vlan', + 'shared': True, + 'subnets': [{'cidr': '192.168.1.0/24', + 'dns_nameservers': ['8.8.4.4', + '8.8.8.8'], + 'floating_ranges': [['192.168.1.2', + '192.168.1.200']], + 'gateway': '192.168.1.1', + 'name': 'subnet2'}, + {'cidr': '172.16.1.0/24', + 'dns_nameservers': ['8.8.4.4', + '8.8.8.8'], + 'floating_ranges': [['172.16.1.130', + '172.16.1.150'], + ['172.16.1.151', + '172.16.1.254']], + 'gateway': '172.16.1.1', + 'name': 'subnet10'}], + 'type': 'internal'}, + {'name': 'flat1', + 'physnet_name': 'physnet1', + 'segmentation_type': 'flat', + 'segmentation_id': -1, + 'shared': True, + 'subnets': [{'cidr': '192.168.2.0/24', + 'dns_nameservers': ['8.8.4.4', + '8.8.8.8'], + 'floating_ranges': [['192.168.2.130', + '192.168.2.254']], + 'gateway': '192.168.2.1', + 'name': 'subnet123'}], + 'type': 'external'} + ], + 'networking_parameters': { + 'base_mac': 'fa:16:3e:00:00:00', + 'gre_id_range': [2, 4094], + 'net_l23_provider': 'ovs', + 'public_vip': '172.16.0.3', + 'segmentation_type': 'vlan,flat,vxlan,gre', + 'vlan_range': [2, 4094], + 'vni_range': [2, 4094]} +} diff --git a/code/daisyclient/daisyclient/v1/shell.py b/code/daisyclient/daisyclient/v1/shell.py index b8f648c7..2fa8986c 100755 --- a/code/daisyclient/daisyclient/v1/shell.py +++ b/code/daisyclient/daisyclient/v1/shell.py @@ -955,7 +955,7 @@ def do_service_update(gc, args): @utils.arg('--nova-lv-size', metavar='', help='the size of logic volume disk for nvoa, and the unit is MB.') @utils.arg('--disk-location', metavar='', - help='where disks used by backends application from, default is "local". \ + help='where disks used by backends from, default is "local". \ "local" means disks come from local host, \ "share" means disks come from share storage devices') @utils.arg('--role-type', metavar='', @@ -1079,7 +1079,7 @@ def do_role_detail(gc, args): @utils.arg('--docker-vg-size', metavar='', help='the size of docker_vg(M).') @utils.arg('--disk-location', metavar='', - help='where disks used by backends application from, default is "local". \ + help='where disks used by backends from, default is "local". \ "local" means disks come from local host, \ "share" means disks come from share storage devices') @utils.arg('--ntp-server', metavar='', diff --git a/code/daisyclient/tox.ini b/code/daisyclient/tox.ini index 9d6cbe39..9b2cbcf5 100755 --- a/code/daisyclient/tox.ini +++ b/code/daisyclient/tox.ini @@ -36,6 +36,6 @@ downloadcache = ~/cache/pip # H302 import only modules # H303 no wildcard import # H404 multi line docstring should start with a summary -ignore = F403,F812,F821,H233,H302,H303,H404,F841,F401,E731,H101,H201,H231,H233,H237,H238,H301,H306,H401,H403,H701,H702,H703,F999 +ignore = F403,F812,F821,H233,H302,H303,H404,F841,F401,E731,H101,H201,H231,H233,H237,H238,H301,H306,H401,H403,H701,H702,H703,F999,H402 show-source = True exclude = .venv,.tox,dist,doc,*egg,build diff --git a/code/horizon/openstack_dashboard/api/daisy.py b/code/horizon/openstack_dashboard/api/daisy.py index 6bd38bac..e7be1652 100755 --- a/code/horizon/openstack_dashboard/api/daisy.py +++ b/code/horizon/openstack_dashboard/api/daisy.py @@ -1,4 +1,22 @@ -from __future__ import absolute_import +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2012 Nebula, 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 __future__ import absolute_import from django.conf import settings diff --git a/code/horizon/openstack_dashboard/dashboards/director_theme/__init__.py b/code/horizon/openstack_dashboard/dashboards/director_theme/__init__.py index 94456aba..e69de29b 100644 --- a/code/horizon/openstack_dashboard/dashboards/director_theme/__init__.py +++ b/code/horizon/openstack_dashboard/dashboards/director_theme/__init__.py @@ -1 +0,0 @@ -# intentionally left blank diff --git a/code/horizon/openstack_dashboard/dashboards/director_theme/models.py b/code/horizon/openstack_dashboard/dashboards/director_theme/models.py index 94456aba..e69de29b 100644 --- a/code/horizon/openstack_dashboard/dashboards/director_theme/models.py +++ b/code/horizon/openstack_dashboard/dashboards/director_theme/models.py @@ -1 +0,0 @@ -# intentionally left blank diff --git a/code/horizon/openstack_dashboard/dashboards/environment/cluster/create_cluster.py b/code/horizon/openstack_dashboard/dashboards/environment/cluster/create_cluster.py index c207d6e1..e74aa0a9 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/cluster/create_cluster.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/cluster/create_cluster.py @@ -1,7 +1,21 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 Nebula, 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 json from django.utils.translation import ugettext_lazy as _ from horizon import exceptions diff --git a/code/horizon/openstack_dashboard/dashboards/environment/cluster/modify_cluster.py b/code/horizon/openstack_dashboard/dashboards/environment/cluster/modify_cluster.py index 6c908619..f0510fd2 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/cluster/modify_cluster.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/cluster/modify_cluster.py @@ -1,7 +1,20 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 Nebula, 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 django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt diff --git a/code/horizon/openstack_dashboard/dashboards/environment/cluster/net_plane.py b/code/horizon/openstack_dashboard/dashboards/environment/cluster/net_plane.py index 4501d66e..6bf79457 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/cluster/net_plane.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/cluster/net_plane.py @@ -1,7 +1,21 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 Nebula, 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 django.http import HttpResponse diff --git a/code/horizon/openstack_dashboard/dashboards/environment/cluster/role.py b/code/horizon/openstack_dashboard/dashboards/environment/cluster/role.py index 29856b63..c677866c 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/cluster/role.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/cluster/role.py @@ -1,7 +1,21 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 Nebula, 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 django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt diff --git a/code/horizon/openstack_dashboard/dashboards/environment/cluster/views.py b/code/horizon/openstack_dashboard/dashboards/environment/cluster/views.py index 85465423..1ab3c1a5 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/cluster/views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/cluster/views.py @@ -1,7 +1,21 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 Nebula, 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 json from django import http diff --git a/code/horizon/openstack_dashboard/dashboards/environment/configure/views.py b/code/horizon/openstack_dashboard/dashboards/environment/configure/views.py index bfe42480..86eddee5 100644 --- a/code/horizon/openstack_dashboard/dashboards/environment/configure/views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/configure/views.py @@ -1,7 +1,20 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 Nebula, 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 django.http import HttpResponse from django.views import generic diff --git a/code/horizon/openstack_dashboard/dashboards/environment/deploy/bonding_views.py b/code/horizon/openstack_dashboard/dashboards/environment/deploy/bonding_views.py index d601a218..d14060cf 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/deploy/bonding_views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/deploy/bonding_views.py @@ -1,7 +1,20 @@ -# -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # +# Copyright 2012 Nebula, 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 json import logging diff --git a/code/horizon/openstack_dashboard/dashboards/environment/deploy/deploy_rule_lib.py b/code/horizon/openstack_dashboard/dashboards/environment/deploy/deploy_rule_lib.py index 6a2dc0ea..e334309c 100644 --- a/code/horizon/openstack_dashboard/dashboards/environment/deploy/deploy_rule_lib.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/deploy/deploy_rule_lib.py @@ -1,7 +1,21 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 Nebula, 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 django.views.decorators.csrf import csrf_exempt from django.utils.translation import ugettext_lazy as _ @@ -385,11 +399,6 @@ def deploy_rule_func(request, cluster_id): def ip_into_int(ip): - """ - Switch ip string to decimalism integer.. - :param ip: ip string - :return: decimalism integer - """ return reduce(lambda x, y: (x << 8) + y, map(int, ip.split('.'))) diff --git a/code/horizon/openstack_dashboard/dashboards/environment/deploy/hosts_config_views.py b/code/horizon/openstack_dashboard/dashboards/environment/deploy/hosts_config_views.py index a14f9bd3..7af74c9d 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/deploy/hosts_config_views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/deploy/hosts_config_views.py @@ -1,7 +1,21 @@ -# -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # +# Copyright 2012 Nebula, 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 os from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt diff --git a/code/horizon/openstack_dashboard/dashboards/environment/deploy/hosts_role_assignment_views.py b/code/horizon/openstack_dashboard/dashboards/environment/deploy/hosts_role_assignment_views.py index 6fa4198e..69ab56c7 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/deploy/hosts_role_assignment_views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/deploy/hosts_role_assignment_views.py @@ -1,7 +1,20 @@ -# -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # +# Copyright 2012 Nebula, 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 json diff --git a/code/horizon/openstack_dashboard/dashboards/environment/deploy/network_mapping_views.py b/code/horizon/openstack_dashboard/dashboards/environment/deploy/network_mapping_views.py index 265b93f7..8ab54ad5 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/deploy/network_mapping_views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/deploy/network_mapping_views.py @@ -1,7 +1,20 @@ -# -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # +# Copyright 2012 Nebula, 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 json diff --git a/code/horizon/openstack_dashboard/dashboards/environment/deploy/os_config_views.py b/code/horizon/openstack_dashboard/dashboards/environment/deploy/os_config_views.py index c9f909e1..42457478 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/deploy/os_config_views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/deploy/os_config_views.py @@ -1,7 +1,20 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 Nebula, 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 django import http from django.views import generic diff --git a/code/horizon/openstack_dashboard/dashboards/environment/deploy/select_host_views.py b/code/horizon/openstack_dashboard/dashboards/environment/deploy/select_host_views.py index aae846c5..f970a4aa 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/deploy/select_host_views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/deploy/select_host_views.py @@ -1,3 +1,21 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2012 Nebula, 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 django.http import HttpResponse from horizon import exceptions as horizon_exceptions diff --git a/code/horizon/openstack_dashboard/dashboards/environment/deploy/tables.py b/code/horizon/openstack_dashboard/dashboards/environment/deploy/tables.py index 891e4cb9..f1502ae1 100644 --- a/code/horizon/openstack_dashboard/dashboards/environment/deploy/tables.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/deploy/tables.py @@ -1,3 +1,21 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2012 Nebula, 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 django.utils.translation import ugettext_lazy as _ diff --git a/code/horizon/openstack_dashboard/dashboards/environment/deploy/views.py b/code/horizon/openstack_dashboard/dashboards/environment/deploy/views.py index 3551c72a..8e23ca21 100644 --- a/code/horizon/openstack_dashboard/dashboards/environment/deploy/views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/deploy/views.py @@ -1,7 +1,20 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 Nebula, 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 json diff --git a/code/horizon/openstack_dashboard/dashboards/environment/healthy/views.py b/code/horizon/openstack_dashboard/dashboards/environment/healthy/views.py index cb8e5dbd..3be98af9 100644 --- a/code/horizon/openstack_dashboard/dashboards/environment/healthy/views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/healthy/views.py @@ -1,7 +1,20 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 Nebula, 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 django.http import HttpResponse from django.views import generic diff --git a/code/horizon/openstack_dashboard/dashboards/environment/host/views.py b/code/horizon/openstack_dashboard/dashboards/environment/host/views.py index 75b774ab..e1071d9b 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/host/views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/host/views.py @@ -1,3 +1,21 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2012 Nebula, 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 horizon import forms from horizon import tables from django import template diff --git a/code/horizon/openstack_dashboard/dashboards/environment/overview/views.py b/code/horizon/openstack_dashboard/dashboards/environment/overview/views.py index e120e35c..9fe99d50 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/overview/views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/overview/views.py @@ -1,3 +1,21 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2012 Nebula, 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 horizon import views from django.utils.translation import ugettext_lazy as _ from django.http import HttpResponse diff --git a/code/horizon/openstack_dashboard/dashboards/environment/overview/workflow.py b/code/horizon/openstack_dashboard/dashboards/environment/overview/workflow.py index 8bed4f4d..aac1f094 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/overview/workflow.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/overview/workflow.py @@ -1,3 +1,21 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2012 Nebula, 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 django.utils.translation import ugettext_lazy as _ from django.views.decorators.debug import sensitive_variables from django.forms.widgets import RadioSelect diff --git a/code/horizon/openstack_dashboard/dashboards/environment/system/system_config_views.py b/code/horizon/openstack_dashboard/dashboards/environment/system/system_config_views.py index e5326c9f..7a4043cf 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/system/system_config_views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/system/system_config_views.py @@ -1,3 +1,21 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. +# +# Copyright 2012 Nebula, 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 horizon import views diff --git a/code/horizon/openstack_dashboard/dashboards/environment/system/views.py b/code/horizon/openstack_dashboard/dashboards/environment/system/views.py index 7d7de533..2ed4130f 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/system/views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/system/views.py @@ -1,7 +1,20 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 Nebula, 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 os import logging diff --git a/code/horizon/openstack_dashboard/dashboards/environment/template/views.py b/code/horizon/openstack_dashboard/dashboards/environment/template/views.py index 964e239b..e80cc0d6 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/template/views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/template/views.py @@ -1,7 +1,20 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 Nebula, 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 django import shortcuts from horizon.utils import memoized diff --git a/code/horizon/openstack_dashboard/dashboards/environment/version/views.py b/code/horizon/openstack_dashboard/dashboards/environment/version/views.py index a3d4b1f6..24261250 100755 --- a/code/horizon/openstack_dashboard/dashboards/environment/version/views.py +++ b/code/horizon/openstack_dashboard/dashboards/environment/version/views.py @@ -1,7 +1,20 @@ +# Copyright 2012 United States Government as represented by the +# Administrator of the National Aeronautics and Space Administration. +# All Rights Reserved. # -# Copyright ZTE -# Daisy Tools Dashboard +# Copyright 2012 Nebula, 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 os import json diff --git a/code/horizon/tox.ini b/code/horizon/tox.ini index 5dfecf62..73d0e59c 100644 --- a/code/horizon/tox.ini +++ b/code/horizon/tox.ini @@ -17,18 +17,15 @@ setenv = VIRTUAL_ENV={envdir} PYTHONHASHSEED=0 deps = -r{toxinidir}/requirements.txt -r{toxinidir}/test-requirements.txt -commands = /bin/bash run_tests.sh -N --no-pep8 {posargs} - +commands = python setup.py testr --testr-args='{posargs}' [testenv:pep8] -commands = - /bin/bash run_tests.sh -N --pep8 - /bin/bash run_tests.sh -N --makemessages --check-only +commands = flake8 [testenv:venv] commands = {posargs} [testenv:cover] -commands = /bin/bash run_tests.sh -N --no-pep8 --coverage {posargs} +commands = python setup.py testr --coverage --testr-args='{posargs}' [testenv:py27dj14] basepython = python2.7 diff --git a/test/tempest/tox.ini b/test/tempest/tox.ini index 4c31607e..b1bedb38 100644 --- a/test/tempest/tox.ini +++ b/test/tempest/tox.ini @@ -1,3 +1,14 @@ +[tox] +envlist = py26,py27,py33,py34,pypy,pep8 +minversion = 1.6 +skipsdist = True + +[testenv:pep8] +commands = flake8 + +[testenv:venv] +commands = {posargs} + [flake8] # E125 is a won't fix until https://github.com/jcrocholl/pep8/issues/126 is resolved. For further detail see https://review.openstack.org/#/c/36788/ # E123 skipped because it is ignored by default in the default pep8 diff --git a/tools/daisy-compile-rpm.sh b/tools/daisy-compile-rpm.sh index 4d1c2e0e..1bafb625 100755 --- a/tools/daisy-compile-rpm.sh +++ b/tools/daisy-compile-rpm.sh @@ -45,4 +45,5 @@ yum -y install \ gcc \ autoconf \ automake \ - glibc-devel + glibc-devel \ + fontawesome-fonts-web