distil/artifice/constants.py
adriant ab75581297 Changes to the config system.
This patch addresses issues with the need for a global config.
Now any module needing config access can simply import the config module.
To facilitate this there were a lot of minor changes to config use throughout artifice,
as well as changes to classes that were passed a config on creation.
Also some changes to constants so that the new config system can work with them easier.

Change-Id: I6e9b4cbf0ff30683dc13e37f13334f7ed7ee7add
2014-04-02 15:55:00 +13:00

27 lines
780 B
Python

# Date format Ceilometer uses
# 2013-07-03T13:34:17
# which is, as an strftime:
# timestamp = datetime.strptime(res["timestamp"], "%Y-%m-%dT%H:%M:%S.%f")
# or
# timestamp = datetime.strptime(res["timestamp"], "%Y-%m-%dT%H:%M:%S")
# Most of the time we use date_format
date_format = "%Y-%m-%dT%H:%M:%S"
# Sometimes things also have milliseconds, so we look for that too.
# Because why not be annoying in all the ways?
other_date_format = "%Y-%m-%dT%H:%M:%S.%f"
# VM states:
states = {'active': 1,
'building': 2,
'paused': 3,
'suspended': 4,
'stopped': 5,
'rescued': 6,
'resized': 7,
'soft_deleted': 8,
'deleted': 9,
'error': 10,
'shelved': 11,
'shelved_offloaded': 12}