
Keystone session can be used directly in user function to access OpenStack services. Include openstack clients in python requirements as well. Add a python function example. Implements: blueprint qinling-openstack-clients Change-Id: I4798c404cb57bafe14049f57ba8db7c7125106c7
13 lines
272 B
Python
13 lines
272 B
Python
import swiftclient
|
|
|
|
|
|
def stat_object(context, container, object):
|
|
conn = swiftclient.Connection(
|
|
session=context['os_session'],
|
|
os_options={'region_name': 'RegionOne'},
|
|
)
|
|
|
|
obj_header = conn.head_object(container, object)
|
|
|
|
return obj_header
|