summaryrefslogtreecommitdiff
path: root/pycadf/timestamp.py
diff options
context:
space:
mode:
authorGordon Chung <chungg@ca.ibm.com>2013-08-07 16:36:33 -0400
committerGordon Chung <chungg@ca.ibm.com>2013-08-07 16:36:33 -0400
commit959e7fc797f368b9809ca2cde704ef0c32de0e70 (patch)
treec23fbe2b19c74f7ed20c4c9fbc867e54fa0d57a9 /pycadf/timestamp.py
parent7bf0f20abe7e721f28d9638c32e05e3e40d95356 (diff)
downloadpycadf-959e7fc797f368b9809ca2cde704ef0c32de0e70.tar.gz
validate attributes against basestring0.1.10.1
- need to update attribute validation to test against basestring instead of str - drop use of openstack logger Change-Id: I2167cf8e468c0e932c476238120d768e5d4d443f Fixes: bug1209387
Diffstat (limited to 'pycadf/timestamp.py')
-rw-r--r--pycadf/timestamp.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/pycadf/timestamp.py b/pycadf/timestamp.py
index 15d87d0..0079c1b 100644
--- a/pycadf/timestamp.py
+++ b/pycadf/timestamp.py
@@ -19,9 +19,6 @@
import datetime
import pytz
-from pycadf.openstack.common import log as logging
-
-LOG = logging.getLogger(__name__)
TIME_FORMAT = "%Y-%m-%dT%H:%M:%S.%f%z"
@@ -30,15 +27,15 @@ def get_utc_now(timezone=None):
if timezone is not None:
try:
utc_datetime = utc_datetime.astimezone(pytz.timezone(timezone))
- except Exception as e:
- LOG.error('Unknown timezone: %s' % e)
+ except Exception:
+ utc_datetime.strftime(TIME_FORMAT)
return utc_datetime.strftime(TIME_FORMAT)
# TODO(mrutkows): validate any cadf:Timestamp (type) record against
# CADF schema
def is_valid(value):
- if not isinstance(value, str):
+ if not isinstance(value, basestring):
raise ValueError('Timestamp should be a String')
return True