-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add iotedgehubdev class * Build solution before start iotedgehubdev * Update templates to fix route error * Fail fast if device connection string is not set before setup * Allow start iotedgehubdev in verbose mode * Add modulecred command * Add gateway_host option to setup command * Add start command * Remove references to runtime * Remove runtime.template.json from template.zip * Only start local registry when pushing images so config/deployment.json only generated after build * Check if the solution is built before starting simulator * Instruct users to setup for starting * Add tests * Enlarge monitor timeout when testing simulator * Fix a issue with spaces in paths * Prevent deploy command overwriting configs * Promote setup, start and stop commands to root * Update unit of monitor timeout to seconds * Add telemetry modules * Update config folder to home dir * Add with_telemetry decorator to commands * Add tests * Defer exception handling to with_telemetry decorator * Fix test failure * Fix unfinished conflict resolve * Added support for windows containers via nanoserver (#158) * added initial support for windows containers * initial support for nanoserver * corrected az cli path * only az not working * all dependencies correctly working * added required pip packages * removed unneeded file * removed external dependencies * completed support for nanoserver * fixed all issued mentioned in PR comments * installing both python2 and python3 on nanoserver * set path to point to python3, since python2 is not working yet * added missing parenthesis * set python3 as default python * mapped folder set automatically * improved build script * added setuptools install * set to use latest tag * added support for powershell script * automatically map folder * added sock mapping * removed pip from requirements since it may generate errors * ignored .backup files * fixed spacings * install modules locally * fixed bug the prevented arguments to be handled correctly * fixed bug the prevented arguments to be handled correctly * added build script alpha version * comments cleanup * build will now also push docker images * Bump version: 0.86.0 → 0.87.0 * version set back to 0.81.0 * fixed some bugs, added parameter for pipy login * modularized build script * fixed syntax * removed renaming of python3 executables * switch to docker folder if needed * exit on error * correctly handled directory switching * switched to ubuntu 18.04 for python 3.6 default support * using double slash to make script work * improved docker image build performances * file system cleanup * added platform parameter * Container docker compose support (#243) Adding docker compose to container * Support for multiple registries (#193) * envvar parsing of multiple container registries * rename value, support for pushing modules based on module.json * string comparison code clean up * modify envvars with better values & refactor dockercls and .env.tmp * modified variable names, minor fixes, added envvar testing specific to container registry * add tests for additional cr, comments to explain code, fix merge conflict * add additional testing for mutliple registries, fix logic around given/expected env vars * fix env load in tests * Tell travis to use DOTENV_FILE * Mod process timeout for new monitor-events (#253) * Merge upstream changes * Rename config to telemetryconfig * Defer telemetry decorator to handle errors * Fix CI failure
- Loading branch information
Showing
18 changed files
with
496 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,4 @@ | |
__author__ = 'Jon Gallant' | ||
__email__ = '[email protected]' | ||
__version__ = '0.81.0' | ||
__AIkey__ = '95b20d64-f54f-4de3-8ad5-165a75a6c6fe' |
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,75 @@ | ||
import hashlib | ||
import sys | ||
from functools import wraps | ||
|
||
|
||
def with_telemetry(func): | ||
@wraps(func) | ||
def _wrapper(*args, **kwargs): | ||
from . import telemetry | ||
from .telemetryconfig import TelemetryConfig | ||
|
||
config = TelemetryConfig() | ||
config.check_firsttime() | ||
params = parse_params(*args, **kwargs) | ||
telemetry.start(func.__name__, params) | ||
try: | ||
value = func(*args, **kwargs) | ||
telemetry.success() | ||
telemetry.flush() | ||
return value | ||
except Exception as e: | ||
from .output import Output | ||
Output().error('Error: {0}'.format(str(e))) | ||
telemetry.fail(str(e), 'Command failed') | ||
telemetry.flush() | ||
sys.exit(1) | ||
|
||
return _wrapper | ||
|
||
|
||
def suppress_all_exceptions(fallback_return=None): | ||
"""We need to suppress exceptions for some internal functions such as those related to telemetry. | ||
They should not be visible to users. | ||
""" | ||
def _decorator(func): | ||
@wraps(func) | ||
def _wrapped_func(*args, **kwargs): | ||
try: | ||
return func(*args, **kwargs) | ||
except Exception: | ||
if fallback_return: | ||
return fallback_return | ||
else: | ||
pass | ||
|
||
return _wrapped_func | ||
|
||
return _decorator | ||
|
||
|
||
@suppress_all_exceptions() | ||
def parse_params(*args, **kwargs): | ||
"""Record the parameter keys and whether the values are None""" | ||
params = [] | ||
for key, value in kwargs.items(): | ||
is_none = '=' | ||
if value is not None: | ||
is_none = '!=' | ||
params.append('{0}{1}None'.format(key, is_none)) | ||
return params | ||
|
||
|
||
def hash256_result(func): | ||
"""Secure the return string of the annotated function with SHA256 algorithm. If the annotated | ||
function doesn't return string or return None, raise ValueError.""" | ||
@wraps(func) | ||
def _decorator(*args, **kwargs): | ||
val = func(*args, **kwargs) | ||
if not val: | ||
raise ValueError('Return value is None') | ||
elif not isinstance(val, str): | ||
raise ValueError('Return value is not string') | ||
hash_object = hashlib.sha256(val.encode('utf-8')) | ||
return str(hash_object.hexdigest()) | ||
return _decorator |
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
Oops, something went wrong.