Skip to content

Commit c3b63f8

Browse files
authored
Refactor config. Issue #75 (#78)
* Refactor config * Fix flake8 * Disabled services with key "enabled" without remove code block * Fix pylint error
1 parent e8db8d8 commit c3b63f8

32 files changed

+293
-239
lines changed
Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
pyms:
2-
requests:
3-
data: ""
4-
swagger:
5-
path: ""
6-
file: "swagger.yaml"
7-
ms:
8-
DEBUG: true
9-
TESTING: false
10-
APP_NAME: "Python Microservice"
11-
APPLICATION_ROOT: ""
12-
request_variable_test: "this is a test"
13-
MyVar: "this is MyVar"
14-
test1: "ttest1"
15-
test2: "ttest2"
2+
services:
3+
requests:
4+
data: ""
5+
swagger:
6+
path: ""
7+
file: "swagger.yaml"
8+
config:
9+
DEBUG: true
10+
TESTING: false
11+
APP_NAME: "Python Microservice"
12+
APPLICATION_ROOT: ""
13+
request_variable_test: "this is a test"
14+
MyVar: "this is MyVar"
15+
test1: "ttest1"
16+
test2: "ttest2"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from pyms.flask.app import Microservice
22

3-
ms = Microservice(service="my-ms", path=__file__)
3+
ms = Microservice(path=__file__)
Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
pyms:
2-
requests:
3-
data: ""
4-
swagger:
5-
path: ""
6-
file: "swagger.yaml"
7-
my-ms:
8-
DEBUG: true
9-
TESTING: false
10-
APP_NAME: "Python Microservice"
11-
APPLICATION_ROOT: ""
2+
services:
3+
requests:
4+
data: ""
5+
swagger:
6+
path: ""
7+
file: "swagger.yaml"
8+
config:
9+
DEBUG: true
10+
TESTING: false
11+
APP_NAME: "Python Microservice"
12+
APPLICATION_ROOT: ""
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
pyms:
2-
swagger:
3-
path: ""
4-
file: "swagger.yaml"
5-
url: "ws-doc/"
6-
my-ms:
7-
DEBUG: true
8-
TESTING: false
9-
APP_NAME: "Python Microservice"
10-
APPLICATION_ROOT: ""
2+
services:
3+
swagger:
4+
path: ""
5+
file: "swagger.yaml"
6+
url: "ws-doc/"
7+
config:
8+
DEBUG: true
9+
TESTING: false
10+
APP_NAME: "Python Microservice"
11+
APPLICATION_ROOT: ""

examples/microservice_swagger/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from pyms.flask.app import Microservice
22

3-
ms = Microservice(service="my-ms", path=__file__)
3+
ms = Microservice(path=__file__)
44
app = ms.create_app()
55

66
if __name__ == '__main__':
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
from pyms.flask.app import Microservice
22

3-
ms = Microservice(service="my-ms", path=__file__)
3+
ms = Microservice(path=__file__)
Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
pyms:
2-
requests:
3-
data: ""
4-
swagger:
5-
path: ""
6-
file: "swagger.yaml"
7-
tracer:
8-
client: "jaeger"
9-
host: "localhost"
10-
component_name: "Python Microservice"
11-
my-ms:
12-
DEBUG: true
13-
TESTING: false
14-
APP_NAME: "Python Microservice"
15-
APPLICATION_ROOT: ""
2+
services:
3+
metrics: true
4+
requests:
5+
data: ""
6+
swagger:
7+
path: ""
8+
file: "swagger.yaml"
9+
tracer:
10+
client: "jaeger"
11+
host: "localhost"
12+
component_name: "Python Microservice"
13+
config:
14+
DEBUG: true
15+
TESTING: false
16+
APP_NAME: "Python Microservice"
17+
APPLICATION_ROOT: ""
Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
my-minimal-microservice:
2-
DEBUG: true
3-
TESTING: false
4-
SWAGGER: true
5-
APP_NAME: business-glossary
6-
APPLICATION_ROOT : ""
7-
SECRET_KEY: "gjr39dkjn344_!67#"
1+
pyms:
2+
config:
3+
DEBUG: true
4+
TESTING: false
5+
SWAGGER: true
6+
APP_NAME: business-glossary
7+
APPLICATION_ROOT : ""
8+
SECRET_KEY: "gjr39dkjn344_!67#"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
pyms:
2+
config:
3+
app_name: "Python Microservice"
4+
environment: "I'm running in docker"

examples/mininum_microservice_docker/config.-docker.yml

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)