Skip to content

Commit 56f8d49

Browse files
committed
lint
Signed-off-by: Gregor Zeitlinger <[email protected]>
1 parent 9647c80 commit 56f8d49

File tree

2 files changed

+19
-24
lines changed

2 files changed

+19
-24
lines changed

.github/workflows/github-pages.yaml

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,12 @@
11
name: Deploy Documentation to Github Pages
22

33
on:
4-
push:
5-
branches: ["main"]
6-
pull_request:
7-
branches: ["main"]
8-
94
# Runs on pushes targeting the 1.0.x branch
10-
# todo revert this
11-
#on:
12-
# push:
13-
# branches:
14-
# - main
15-
# tags:
16-
# - "v*.*.*" # updates the version in the docs
5+
push:
6+
branches:
7+
- main
8+
tags:
9+
- "v*.*.*" # updates the version in the docs
1710

1811
# Allows you to run this workflow manually from the Actions tab
1912
workflow_dispatch:

examples/example-exporter-opentelemetry/oats-tests/agent/service_instance_id_check.py

+14-12
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,22 @@
33
"""This script is used to check if the service instance id is present in the exported data
44
The script will return 0 if the service instance id is present in the exported data"""
55

6+
import json
67
import urllib.parse
78
from urllib.request import urlopen
89

9-
URL = " http://localhost:9090/api/v1/query?query=target_info"
10-
with urlopen(URL) as response:
11-
# read the response
12-
res = response.read()
13-
# decode the response
14-
res = res.decode("utf-8")
10+
11+
def get(url):
12+
global response, res
13+
with urlopen(url) as response:
14+
# read the response
15+
res = response.read()
16+
# decode the response
17+
res = json.loads(res.decode("utf-8"))
18+
return res
19+
20+
21+
res = get(" http://localhost:9090/api/v1/query?query=target_info")
1522

1623
# uncomment the following line to use the local file instead of the url - for debugging
1724
# with open('example_target_info.json') as f:
@@ -31,12 +38,7 @@
3138

3239
path = f'target_info{{instance="{values[0]}"}}'
3340
path = urllib.parse.quote_plus(path)
34-
URL = f"http://localhost:9090/api/v1/query?query={path}"
35-
with urlopen(URL) as response:
36-
# read the response
37-
res = response.read()
38-
# decode the response
39-
res = res.decode("utf-8")
41+
res = get(f"http://localhost:9090/api/v1/query?query={path}")
4042

4143
infos = res["data"]["result"]
4244
print(infos)

0 commit comments

Comments
 (0)