-
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.
adding nwrc check back but simpler to test for #197
- Loading branch information
Scott Havens
committed
Nov 18, 2020
1 parent
f96286b
commit 2623a9b
Showing
2 changed files
with
26 additions
and
2 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,19 @@ | ||
import requests | ||
|
||
|
||
class NWRCCheck(object): | ||
|
||
HOST = '10.200.28.50/dashboard' | ||
URL = 'http://' + HOST | ||
|
||
@classmethod | ||
def in_network(cls): | ||
""" | ||
Checks that were on the NWRC network | ||
""" | ||
try: | ||
response = requests.get(cls.URL, timeout=1) | ||
return response.ok | ||
|
||
except requests.exceptions.RequestException: | ||
return False |