diff options
author | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-09-13 09:12:44 +0800 |
---|---|---|
committer | ying.yunlong <ying.yunlong@zte.com.cn> | 2017-09-13 09:12:44 +0800 |
commit | 70baa47927aeb5f4562172651d21b47fd56bb19e (patch) | |
tree | cddfdcae54853f2c2325701fb6c2728bf7c00ede /res | |
parent | e2e54618859bf098a7f06c106d869d3765e7f04c (diff) |
Modify gvnfm vnfres code according to PEP8
Change-Id: Ifb0779e25aa27cca634324603e8e5a6d130adacc
Issue-ID: VFC-344
Signed-off-by: ying.yunlong <ying.yunlong@zte.com.cn>
Diffstat (limited to 'res')
-rw-r--r-- | res/README.md | 1 | ||||
-rw-r--r-- | res/assembly.xml | 2 | ||||
-rwxr-xr-x | res/assembly/bin/initDB.sh | 3 | ||||
-rw-r--r-- | res/assembly/dbscripts/mysql/onap-gvnfm-vnfres-createdb.sql | 3 | ||||
-rw-r--r-- | res/assembly/dbscripts/mysql/onap-gvnfm-vnfres-createobj.sql | 2 | ||||
-rw-r--r-- | res/docker/LICENSE | 2 | ||||
-rwxr-xr-x | res/docker/instance_run.sh | 2 | ||||
-rwxr-xr-x | res/initialize.sh | 2 | ||||
-rw-r--r-- | res/manage.py | 1 | ||||
-rw-r--r-- | res/pom.xml | 2 | ||||
-rw-r--r-- | res/res/pub/config/config.py | 2 | ||||
-rw-r--r-- | res/res/pub/database/models.py | 7 | ||||
-rw-r--r-- | res/res/resources/tests.py | 4 | ||||
-rw-r--r-- | res/res/resources/urls.py | 1 | ||||
-rw-r--r-- | res/res/resources/views.py | 5 | ||||
-rw-r--r-- | res/res/settings.py | 1 | ||||
-rw-r--r-- | res/res/urls.py | 1 | ||||
-rwxr-xr-x | res/run.sh | 2 | ||||
-rwxr-xr-x | res/stop.sh | 2 |
19 files changed, 31 insertions, 14 deletions
diff --git a/res/README.md b/res/README.md index 28f16fe..ec4a35a 100644 --- a/res/README.md +++ b/res/README.md @@ -12,4 +12,5 @@ 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. + Micro service of vnf resource management. diff --git a/res/assembly.xml b/res/assembly.xml index b85e1d5..1e87a78 100644 --- a/res/assembly.xml +++ b/res/assembly.xml @@ -13,6 +13,8 @@ See the License for the specific language governing permissions and limitations under the License. --> + + <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> diff --git a/res/assembly/bin/initDB.sh b/res/assembly/bin/initDB.sh index 1ed4863..5ad52f5 100755 --- a/res/assembly/bin/initDB.sh +++ b/res/assembly/bin/initDB.sh @@ -13,7 +13,7 @@ # 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. -# + DIRNAME=`dirname $0` HOME=`cd $DIRNAME/; pwd` @@ -47,4 +47,3 @@ do done echo "init resource management database success!" exit 0 - diff --git a/res/assembly/dbscripts/mysql/onap-gvnfm-vnfres-createdb.sql b/res/assembly/dbscripts/mysql/onap-gvnfm-vnfres-createdb.sql index 32d2450..941ad16 100644 --- a/res/assembly/dbscripts/mysql/onap-gvnfm-vnfres-createdb.sql +++ b/res/assembly/dbscripts/mysql/onap-gvnfm-vnfres-createdb.sql @@ -12,7 +12,6 @@ -- 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. --- /******************drop old database and user***************************/ @@ -29,4 +28,4 @@ GRANT ALL PRIVILEGES ON mysql.* TO 'gvnfm'@'%' IDENTIFIED BY 'gvnfm' WITH GRANT GRANT ALL PRIVILEGES ON gvnfm.* TO 'gvnfm'@'localhost' IDENTIFIED BY 'gvnfm' WITH GRANT OPTION; GRANT ALL PRIVILEGES ON mysql.* TO 'gvnfm'@'localhost' IDENTIFIED BY 'gvnfm' WITH GRANT OPTION; -FLUSH PRIVILEGES;
\ No newline at end of file +FLUSH PRIVILEGES; diff --git a/res/assembly/dbscripts/mysql/onap-gvnfm-vnfres-createobj.sql b/res/assembly/dbscripts/mysql/onap-gvnfm-vnfres-createobj.sql index 86a2010..1facf38 100644 --- a/res/assembly/dbscripts/mysql/onap-gvnfm-vnfres-createobj.sql +++ b/res/assembly/dbscripts/mysql/onap-gvnfm-vnfres-createobj.sql @@ -12,7 +12,7 @@ -- 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. --- + use gvnfm; diff --git a/res/docker/LICENSE b/res/docker/LICENSE index 5c767c3..dd08487 100644 --- a/res/docker/LICENSE +++ b/res/docker/LICENSE @@ -470,4 +470,4 @@ understandings, or agreements concerning use of licensed material. For the avoidance of doubt, this paragraph does not form part of the public licenses. -Creative Commons may be contacted at creativecommons.org.
\ No newline at end of file +Creative Commons may be contacted at creativecommons.org. diff --git a/res/docker/instance_run.sh b/res/docker/instance_run.sh index 196edfd..8aac538 100755 --- a/res/docker/instance_run.sh +++ b/res/docker/instance_run.sh @@ -7,4 +7,4 @@ chmod +x run.sh while [ ! -f logs/runtime_res.log ]; do sleep 1 done -tail -F logs/runtime_res.log
\ No newline at end of file +tail -F logs/runtime_res.log diff --git a/res/initialize.sh b/res/initialize.sh index 7ace382..1bde84f 100755 --- a/res/initialize.sh +++ b/res/initialize.sh @@ -12,4 +12,6 @@ # 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. + + pip install -r requirements.txt diff --git a/res/manage.py b/res/manage.py index 790d22b..a9dc4bf 100644 --- a/res/manage.py +++ b/res/manage.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + import os import sys diff --git a/res/pom.xml b/res/pom.xml index 5ce8ae5..03b99d4 100644 --- a/res/pom.xml +++ b/res/pom.xml @@ -14,6 +14,8 @@ See the License for the specific language governing permissions and limitations under the License.11 --> + + <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <parent> <groupId>org.onap.vfc.gvnfm.vnfres</groupId> diff --git a/res/res/pub/config/config.py b/res/res/pub/config/config.py index 86701be..6c06553 100644 --- a/res/res/pub/config/config.py +++ b/res/res/pub/config/config.py @@ -11,6 +11,8 @@ # 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 # [MSB] diff --git a/res/res/pub/database/models.py b/res/res/pub/database/models.py index c701e20..af794b7 100644 --- a/res/res/pub/database/models.py +++ b/res/res/pub/database/models.py @@ -11,6 +11,8 @@ # 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.db import models @@ -311,8 +313,3 @@ class FlavourInstModel(models.Model): def __unicode__(self): return '%s' % self.name - - - - - diff --git a/res/res/resources/tests.py b/res/res/resources/tests.py index 4bddc71..7211b81 100644 --- a/res/res/resources/tests.py +++ b/res/res/resources/tests.py @@ -11,6 +11,8 @@ # 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.test import TestCase, Client from rest_framework import status @@ -212,4 +214,4 @@ class ResourceTest(TestCase): def test_swagger_ok(self): resp = self.client.get("/api/vnfres/v1/swagger.json", format='json') - self.assertEqual(resp.status_code, status.HTTP_200_OK, resp.content)
\ No newline at end of file + self.assertEqual(resp.status_code, status.HTTP_200_OK, resp.content) diff --git a/res/res/resources/urls.py b/res/res/resources/urls.py index b855a60..5920115 100644 --- a/res/res/resources/urls.py +++ b/res/res/resources/urls.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + from django.conf.urls import url from rest_framework.urlpatterns import format_suffix_patterns diff --git a/res/res/resources/views.py b/res/res/resources/views.py index 38de8e1..8171c5c 100644 --- a/res/res/resources/views.py +++ b/res/res/resources/views.py @@ -11,6 +11,8 @@ # 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 import os @@ -340,6 +342,7 @@ def fill_cps_data(cp): } return cps_data + @api_view(http_method_names=['GET']) def get_volumes(request, *args, **kwargs): logger.debug("Query all the volumes by vnfInstanceId[%s]", fun_name()) @@ -376,4 +379,4 @@ class SwaggerJsonView(APIView): f = open(json_file) json_data = json.JSONDecoder().decode(f.read()) f.close() - return Response(json_data)
\ No newline at end of file + return Response(json_data) diff --git a/res/res/settings.py b/res/res/settings.py index 6b19ab5..e7de314 100644 --- a/res/res/settings.py +++ b/res/res/settings.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + import os import sys diff --git a/res/res/urls.py b/res/res/urls.py index 9db7895..29cdac7 100644 --- a/res/res/urls.py +++ b/res/res/urls.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. + from django.conf.urls import include, url from res.pub.config.config import REG_TO_MSB_WHEN_START, REG_TO_MSB_REG_URL, REG_TO_MSB_REG_PARAM @@ -12,4 +12,6 @@ # 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. + + nohup python manage.py runserver 127.0.0.1:8802 > /dev/null & diff --git a/res/stop.sh b/res/stop.sh index af83565..2b65ea8 100755 --- a/res/stop.sh +++ b/res/stop.sh @@ -12,4 +12,6 @@ # 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. + + ps auxww | grep 'manage.py runserver 127.0.0.1:8802' | awk '{print $2}' | xargs kill -9 |