def __init__(self, user_id, project_id, is_admin=None, read_deleted="no", roles=None, remote_address=None, timestamp=None, request_id=None, auth_token=None, strategy='noauth'): """ :param read_deleted: 'no' indicates deleted records are hidden, 'yes' indicates deleted records are visible, 'only' indicates that *only* deleted records are visible. """ self.user_id = user_id self.project_id = project_id self.roles = roles or [] self.is_admin = is_admin if self.is_admin is None: self.is_admin = 'admin' in [x.lower() for x in self.roles] self.read_deleted = read_deleted self.remote_address = remote_address if not timestamp: timestamp = utils.utcnow() if isinstance(timestamp, basestring): timestamp = utils.parse_strtime(timestamp) self.timestamp = timestamp if not request_id: request_id = unicode(uuid.uuid4()) self.request_id = request_id self.auth_token = auth_token self.strategy = strategy local.store.context = self
def fake_vpn_instance_low_id(): return { 'id': 4, 'image_id': FLAGS.vpn_image_id, 'vm_state': 'active', 'created_at': utils.parse_strtime('1981-10-20T00:00:00.000000') }
def fake_vpn_instance_low_id(): return {'id': 4, 'image_id': FLAGS.vpn_image_id, 'vm_state': 'active', 'created_at': utils.parse_strtime('1981-10-20T00:00:00.000000')}