summaryrefslogtreecommitdiff
path: root/azurelinuxagent/common/event.py
diff options
context:
space:
mode:
Diffstat (limited to 'azurelinuxagent/common/event.py')
-rw-r--r--azurelinuxagent/common/event.py21
1 files changed, 12 insertions, 9 deletions
diff --git a/azurelinuxagent/common/event.py b/azurelinuxagent/common/event.py
index 374b0e7..4037622 100644
--- a/azurelinuxagent/common/event.py
+++ b/azurelinuxagent/common/event.py
@@ -32,21 +32,24 @@ from azurelinuxagent.common.protocol.restapi import TelemetryEventParam, \
TelemetryEvent, \
set_properties, get_properties
from azurelinuxagent.common.version import DISTRO_NAME, DISTRO_VERSION, \
- DISTRO_CODE_NAME, AGENT_VERSION
+ DISTRO_CODE_NAME, AGENT_VERSION, \
+ CURRENT_AGENT, CURRENT_VERSION
class WALAEventOperation:
+ ActivateResourceDisk="ActivateResourceDisk"
+ Disable = "Disable"
+ Download = "Download"
+ Enable = "Enable"
+ HealthCheck = "HealthCheck"
HeartBeat="HeartBeat"
- Provision = "Provision"
Install = "Install"
+ Provision = "Provision"
+ Restart="Restart"
+ UnhandledError="UnhandledError"
UnInstall = "UnInstall"
- Disable = "Disable"
- Enable = "Enable"
- Download = "Download"
Upgrade = "Upgrade"
Update = "Update"
- ActivateResourceDisk="ActivateResourceDisk"
- UnhandledError="UnhandledError"
class EventLogger(object):
def __init__(self):
@@ -71,7 +74,7 @@ class EventLogger(object):
except IOError as e:
raise EventError("Failed to write events to file:{0}", e)
- def add_event(self, name, op="", is_success=True, duration=0, version=AGENT_VERSION,
+ def add_event(self, name, op="", is_success=True, duration=0, version=CURRENT_VERSION,
message="", evt_type="", is_internal=False):
event = TelemetryEvent(1, "69B669B9-4AF8-4C50-BDC4-6006FA76E975")
event.parameters.append(TelemetryEventParam('Name', name))
@@ -92,7 +95,7 @@ class EventLogger(object):
__event_logger__ = EventLogger()
-def add_event(name, op="", is_success=True, duration=0, version=AGENT_VERSION,
+def add_event(name, op="", is_success=True, duration=0, version=CURRENT_VERSION,
message="", evt_type="", is_internal=False,
reporter=__event_logger__):
log = logger.info if is_success else logger.error