If no wlan0 device is + available, one is generated into DEVICE_ID_PATH. + + This is derived from the wlan0 MAC address. +IMAGE_ID_PATH = os.path.join(EVENT_LOG_DIR, ".image_id") + +WLAN0_MAC_PATH = "/sys/class/net/wlan0/address" + +PREFIX_RE = re.compile("^+$") +EVENT_NAME_RE = re.compile("^+$") +EVENT_KEY_RE = EVENT_NAME_RE + +device_id = None +image_id = None + + +def GetDeviceId(): + """Returns the device ID. +DEVICE_ID_PATH = os.path.join(EVENT_LOG_DIR, ".device_id") + +# Path to use to generate an image ID in case none exists (i.e., +# this is the first time we're creating an event log). + +EVENT_LOG_DIR = os.path.join(factory.get_state_root(), "events") + +# Path to use to generate a device ID in case none exists (i.e., +# there is no wlan0 interface). + """ + return ("%08x" % (int(time.time() * 100) & 0xFFFFFFFF) + + str(uuid4())) + + +def YamlDump(structured_data): + """Wrap yaml.dump to make calling convention consistent.""" + return yaml.dump(structured_data, + default_flow_style=False, + allow_unicode=True) + + +# TODO(tammo): Replace these definitions references to real canonical +# data, once the corresponding modules move over from the autotest +# repo. This will roll over once every 490 days, but it + will cause UUIDs to be sorted by time in the vast majority of cases + (handy for ls'ing directories) and it still contains far more than + enough randomness to remain unique.
#Linux logtail norwap mod
+ + The first 8 hexits are replaced by the current time in 100ths of a + second, mod 2**32. +TimeString = utils.TimeString + + +def TimedUuid(): + """Returns a UUID that is roughly sorted by time. + +"""Routines for producing event logs.""" + + +import logging +import re +import os +import threading +import time +import yaml + +from uuid import uuid4 + +import factory_common +from autotest_ import factory +from autotest_ import utils + + +class EventLogException(Exception): + pass + + +# Since gooftool uses this.
#Linux logtail norwap code
+# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. Merge branch 'master' of /home/tammo/src/autotest into merge_atÄiff -git a/py/event_log.py b/py/event_log.py