-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add endpoint to check if azure copy is working
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
""" | ||
check Azure related system health | ||
""" | ||
|
||
from serverpkg.server import app | ||
from ..logger import Logger | ||
logger = Logger(__name__).logger | ||
|
||
def check_azcopy(): | ||
""":return True if succeed uploading a file to my subs/container; False otherwise """ | ||
import subprocess | ||
completed_proc = subprocess.run( [app.config['runner_dir'] + '/check_azcopy.sh'], stdout=subprocess.PIPE, stderr=subprocess.PIPE, check=False) | ||
|
||
if completed_proc.returncode != 0: | ||
logger.info("STDERR:\n" + completed_proc.stderr.decode('utf-8')) | ||
|
||
return completed_proc.returncode == 0 |