Skip to content
This repository has been archived by the owner on Feb 20, 2024. It is now read-only.

Commit

Permalink
simpler run
Browse files Browse the repository at this point in the history
  • Loading branch information
adonm committed May 28, 2022
1 parent 35450a8 commit 799484b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 33 deletions.
31 changes: 1 addition & 30 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def upload_results(results, blobdest, filenamekeys):
"--put-md5",
"--overwrite=ifSourceNewer",
"--recursive=true",
"--as-subdir=false"
"--as-subdir=false",
]
print(cmd)
run(cmd)
Expand Down Expand Up @@ -206,35 +206,6 @@ def debug_server():

azcli(["extension", "add", "-n", "log-analytics", "-y"])
azcli(["extension", "add", "-n", "resource-graph", "-y"])
try:
check_output(["azcopy", "--version"])
except:
run(
[
"curl",
"-L",
"https://aka.ms/downloadazcopy-v10-linux",
"-o",
"azcopy.tar.gz",
]
)
run(
[
"sudo",
"tar",
"xvf",
"azcopy.tar.gz",
"-C",
"/usr/local/bin",
"--strip",
"1",
"--wildcards",
"*/azcopy",
"--no-same-owner",
]
)
run(["sudo", "chmod", "a+x", "/usr/local/bin/azcopy"])
os.remove("azcopy.tar.gz")
os.environ["API_TOKEN"] = "DEBUG"
uvicorn.run("main:app", log_level="debug", reload=True)

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ fastapi[all]
python-dateutil
fire
peewee
apsw
4 changes: 2 additions & 2 deletions sqlitecache.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
from collections import namedtuple
from functools import wraps
from hashlib import sha256
from playhouse.apsw_ext import APSWDatabase, BlobField, CharField, DateTimeField, Model
from peewee import SqliteDatabase, BlobField, CharField, DateTimeField, Model

db = APSWDatabase(f"/tmp/siemqueryutils_{datetime.now().date()}.sqlitecache")
db = SqliteDatabase(f"/tmp/siemqueryutils_{datetime.now().date()}.sqlitecache")

# named tuples need to be defined here for pickle to introspect
Workspace = namedtuple("Workspace", "subscription, customerId, resourceGroup, name")
Expand Down

0 comments on commit 799484b

Please sign in to comment.