context.py (ec2-api-14.0.1) | : | context.py (ec2-api-15.0.0) | ||
---|---|---|---|---|
skipping to change at line 21 | skipping to change at line 21 | |||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
# See the License for the specific language governing permissions and | # See the License for the specific language governing permissions and | |||
# limitations under the License. | # limitations under the License. | |||
"""RequestContext: context for requests that persist through all of ec2.""" | """RequestContext: context for requests that persist through all of ec2.""" | |||
from oslo_config import cfg | from oslo_config import cfg | |||
from oslo_context import context | from oslo_context import context | |||
from oslo_log import log as logging | from oslo_log import log as logging | |||
from oslo_utils import timeutils | from oslo_utils import timeutils | |||
import six | ||||
from ec2api import clients | from ec2api import clients | |||
from ec2api import exception | from ec2api import exception | |||
CONF = cfg.CONF | CONF = cfg.CONF | |||
LOG = logging.getLogger(__name__) | LOG = logging.getLogger(__name__) | |||
class RequestContext(context.RequestContext): | class RequestContext(context.RequestContext): | |||
"""Security context and request information. | """Security context and request information. | |||
skipping to change at line 71 | skipping to change at line 70 | |||
kwargs.pop('user_identity', None) | kwargs.pop('user_identity', None) | |||
self.session = kwargs.pop('session', None) | self.session = kwargs.pop('session', None) | |||
if kwargs: | if kwargs: | |||
LOG.warning('Arguments dropped when creating context: %s', | LOG.warning('Arguments dropped when creating context: %s', | |||
str(kwargs)) | str(kwargs)) | |||
self.user_id = user_id | self.user_id = user_id | |||
self.project_id = project_id | self.project_id = project_id | |||
self.remote_address = remote_address | self.remote_address = remote_address | |||
timestamp = timeutils.utcnow() | timestamp = timeutils.utcnow() | |||
if isinstance(timestamp, six.string_types): | if isinstance(timestamp, str): | |||
timestamp = timeutils.parse_strtime(timestamp) | timestamp = timeutils.parse_strtime(timestamp) | |||
self.timestamp = timestamp | self.timestamp = timestamp | |||
self.service_catalog = service_catalog | self.service_catalog = service_catalog | |||
if self.service_catalog is None: | if self.service_catalog is None: | |||
# if list is empty or none | # if list is empty or none | |||
self.service_catalog = [] | self.service_catalog = [] | |||
self.user_name = user_name | self.user_name = user_name | |||
self.project_name = project_name | self.project_name = project_name | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added |