def connect_swift(): http_conn = swiftclient.http_connection(PRE_AUTH_URL) try: swiftclient.head_container(PRE_AUTH_URL, PRE_AUTH_TOKEN, CONTAINER_NAME, http_conn=http_conn) except swiftclient.ClientException: swiftclient.put_container(PRE_AUTH_URL, PRE_AUTH_TOKEN, CONTAINER_NAME, http_conn=http_conn) return http_conn
def __init__(self): self.last_headers_name = None self.last_headers_value = None # Get authentication token self.storage_url, self.token = swiftclient.get_auth( self.api_auth_url, self.api_username, self.api_key, auth_version=self.auth_version, os_options=dict( list({ "tenant_id": self.tenant_id, "tenant_name": self.tenant_name }.items()) + list(self.os_extra_options.items())), ) self.http_conn = swiftclient.http_connection(self.storage_url) # Check container try: swiftclient.head_container(self.storage_url, self.token, self.container_name, http_conn=self.http_conn) except swiftclient.ClientException: headers = {} if self.auto_create_container: if self.auto_create_container_public: headers['X-Container-Read'] = '.r:*' swiftclient.put_container(self.storage_url, self.token, self.container_name, http_conn=self.http_conn, headers=headers) else: raise ImproperlyConfigured("Container %s does not exist." % self.container_name) if self.auto_base_url: # Derive a base URL based on the authentication information from # the server, optionally overriding the protocol, host/port and # potentially adding a path fragment before the auth information. self.base_url = self.storage_url + '/' if self.override_base_url is not None: # override the protocol and host, append any path fragments split_derived = urllib.parse.urlsplit(self.base_url) split_override = urllib.parse.urlsplit(self.override_base_url) split_result = [''] * 5 split_result[0:2] = split_override[0:2] split_result[2] = (split_override[2] + split_derived[2]).replace('//', '/') self.base_url = urllib.parse.urlunsplit(split_result) self.base_url = urllib.parse.urljoin(self.base_url, self.container_name) self.base_url += '/' else: self.base_url = self.override_base_url
def __init__(self, **settings): # check if some of the settings provided as class attributes # should be overwritten for name, value in settings.items(): if hasattr(self, name): setattr(self, name, value) self.last_headers_name = None self.last_headers_value = None # Get authentication token self.storage_url, self.token = swiftclient.get_auth( self.api_auth_url, self.api_username, self.api_key, auth_version=self.auth_version, os_options={"tenant_name": self.tenant_name}, ) self.http_conn = swiftclient.http_connection(self.storage_url) # Check container try: swiftclient.head_container(self.storage_url, self.token, self.container_name, http_conn=self.http_conn) except swiftclient.ClientException: if self.auto_create_container: swiftclient.put_container(self.storage_url, self.token, self.container_name, http_conn=self.http_conn) else: raise ImproperlyConfigured("Container %s does not exist." % self.container_name) if self.auto_base_url: # Derive a base URL based on the authentication information from # the server, optionally overriding the protocol, host/port and # potentially adding a path fragment before the auth information. self.base_url = self.storage_url + '/' if self.override_base_url is not None: # override the protocol and host, append any path fragments split_derived = urlparse.urlsplit(self.base_url) split_override = urlparse.urlsplit(self.override_base_url) split_result = [''] * 5 split_result[0:2] = split_override[0:2] split_result[2] = (split_override[2] + split_derived[2]).replace('//', '/') self.base_url = urlparse.urlunsplit(split_result) self.base_url = urlparse.urljoin(self.base_url, self.container_name) self.base_url += '/' else: self.base_url = self.override_base_url
def __init__(self): self.last_headers_name = None self.last_headers_value = None # Get authentication token self.storage_url, self.token = swiftclient.get_auth( self.api_auth_url, self.api_username, self.api_key, auth_version=self.auth_version, os_options=dict({"tenant_name": self.tenant_name}.items() + self.os_extra_options.items()), cacert=self.custom_ca, insecure=self.ssl_insecure ) self.http_conn = swiftclient.http_connection(self.storage_url) # Check container try: swiftclient.head_container(self.storage_url, self.token, self.container_name, http_conn=self.http_conn) except swiftclient.ClientException: headers = {} if self.auto_create_container: if self.auto_create_container_public: headers['X-Container-Read'] = '.r:*' swiftclient.put_container(self.storage_url, self.token, self.container_name, http_conn=self.http_conn, headers=headers) else: raise ImproperlyConfigured( "Container %s does not exist." % self.container_name) if self.auto_base_url: # Derive a base URL based on the authentication information from # the server, optionally overriding the protocol, host/port and # potentially adding a path fragment before the auth information. self.base_url = self.storage_url + '/' if self.override_base_url is not None: # override the protocol and host, append any path fragments split_derived = urlparse.urlsplit(self.base_url) split_override = urlparse.urlsplit(self.override_base_url) split_result = [''] * 5 split_result[0:2] = split_override[0:2] split_result[2] = (split_override[2] + split_derived[2]).replace('//', '/') self.base_url = urlparse.urlunsplit(split_result) self.base_url = urlparse.urljoin(self.base_url, self.container_name) self.base_url += '/' else: self.base_url = self.override_base_url
def __init__(self, **settings): # check if some of the settings provided as class attributes # should be overwritten for name, value in settings.items(): if hasattr(self, name): setattr(self, name, value) self.last_headers_name = None self.last_headers_value = None # Get authentication token self.storage_url, self.token = swiftclient.get_auth( self.api_auth_url, self.api_username, self.api_key, auth_version=self.auth_version, os_options={"tenant_name": self.tenant_name}, ) self.http_conn = swiftclient.http_connection(self.storage_url) # Check container try: swiftclient.head_container(self.storage_url, self.token, self.container_name, http_conn=self.http_conn) except swiftclient.ClientException: if self.auto_create_container: swiftclient.put_container(self.storage_url, self.token, self.container_name, http_conn=self.http_conn) else: raise ImproperlyConfigured( "Container %s does not exist." % self.container_name) if self.auto_base_url: # Derive a base URL based on the authentication information from # the server, optionally overriding the protocol, host/port and # potentially adding a path fragment before the auth information. self.base_url = self.storage_url + '/' if self.override_base_url is not None: # override the protocol and host, append any path fragments split_derived = urlparse.urlsplit(self.base_url) split_override = urlparse.urlsplit(self.override_base_url) split_result = [''] * 5 split_result[0:2] = split_override[0:2] split_result[2] = (split_override[2] + split_derived[2]).replace('//', '/') self.base_url = urlparse.urlunsplit(split_result) self.base_url = urlparse.urljoin(self.base_url, self.container_name) self.base_url += '/' else: self.base_url = self.override_base_url
def head_container(self, container_name): token = self.fetch_token() url = self.auth['endpoint_url'] try: response = head_container(url=url, token=token, container=container_name) except ClientException: response = None return response
marker=marker) except ClientException, err: resp = Response(charset='utf8') resp.status = err.http_status return resp cont_meta = {} cont_acl = {} cont_unquote_name = {} cont_version_cont = {} cont_sync_to = {} cont_sync_key = {} # pick only one container for confiming and editing edit_param = [acl_edit, delete_confirm, meta_edit, contsync_edit] if any(edit_param): edit_cont = filter(None, edit_param)[0] meta = head_container(storage_url, token, edit_cont) cont_list = [{ 'name': edit_cont, 'count': meta.get('x-container-object-count'), 'bytes': meta.get('x-container-bytes-used') }] # get matadata for each containers for i in cont_list: try: meta = head_container(storage_url, token, i['name']) except ClientException, err: resp = Response(charset='utf8') resp.status = e.http_status return resp cont_meta[i['name']] = dict([ (m[len('x-container-meta-'):].capitalize(), meta[m])
dest_storage_url, dest_token, container_name, ): try: orig_container_headers, orig_objects = swiftclient.get_container( None, orig_token, container_name, http_conn=orig_storage_cnx ) except (swiftclient.client.ClientException), e: logging.info("ERROR: getting container: %s, %s" % (container_name, e.http_reason)) return try: # Check that the container exists on dest swiftclient.head_container("", dest_token, container_name, http_conn=dest_storage_cnx) except (swiftclient.client.ClientException), e: container_headers = orig_container_headers.copy() for h in ("x-container-object-count", "x-trans-id", "x-container-bytes-used"): del container_headers[h] p = dest_storage_cnx[0] url = "%s://%s%s" % (p.scheme, p.netloc, p.path) try: swiftclient.put_container(url, dest_token, container_name, headers=container_headers) except (swiftclient.client.ClientException), e: logging.info("ERROR: creating container: %s, %s" % (container_name, e.http_reason)) return try: dest_container_headers, dest_objects = swiftclient.get_container( None, dest_token, container_name, http_conn=dest_storage_cnx
orig_container_headers, orig_objects = swiftclient.get_container( None, orig_token, container_name, http_conn=orig_storage_cnx, full_listing=True, ) except (swiftclient.client.ClientException), e: logging.info("ERROR: getting container: %s, %s" % (container_name, e.http_reason)) return try: # Check that the container exists on dest swiftclient.head_container("", dest_token, container_name, http_conn=dest_storage_cnx) except (swiftclient.client.ClientException), e: container_headers = orig_container_headers.copy() for h in ('x-container-object-count', 'x-trans-id', 'x-container-bytes-used'): try: del container_headers[h] except KeyError: # Nov2013: swift server does not set x-trans-id header pass p = dest_storage_cnx[0] url = "%s://%s%s" % (p.scheme, p.netloc, p.path) try: swiftclient.put_container(url, dest_token,
#print rv # delete a container #rv = SWIFT.delete_object(swift_url, auth_token, container='testdir') #print rv # create a container """ element_id += 1 container_meta = {'X-Container-Meta-ID' : element_id, 'X-Container-Meta-Creator' : user} rv = SWIFT.put_container(swift_url, auth_token, container_name, headers=container_meta ) print 'put_container:', rv """ # get container info stats = SWIFT.head_container(swift_url, auth_token, container_name) print 'stats for testdir:', stats # store 10 objects for x in xrange(10): # create an object element_id += 1 object_meta = {'X-Object-Meta-ID' : element_id, 'X-Object-Meta-Creator' : user} obj_etag = SWIFT.put_object(swift_url, auth_token, container=container_name, name=obj_name+str(element_id), contents=contents, headers=object_meta ) print 'put_object:', obj_etag """ # get container info and list objects in container objs = SWIFT.get_container(swift_url, auth_token, container_name, marker='testobj10')
marker=marker) except ClientException, err: resp = Response(charset='utf8') resp.status = err.http_status return resp cont_meta = {} cont_acl = {} cont_unquote_name = {} cont_version_cont = {} cont_sync_to = {} cont_sync_key = {} # pick only one container for confiming and editing edit_param = [acl_edit, delete_confirm, meta_edit, contsync_edit] if any(edit_param): edit_cont = filter(None, edit_param)[0] meta = head_container(storage_url, token, edit_cont) cont_list = [{'name': edit_cont, 'count': meta.get('x-container-object-count'), 'bytes': meta.get('x-container-bytes-used')}] # get matadata for each containers for i in cont_list: try: meta = head_container(storage_url, token, i['name']) except ClientException, err: resp = Response(charset='utf8') resp.status = e.http_status return resp cont_meta[i['name']] = dict( [(m[len('x-container-meta-'):].capitalize(), meta[m]) for m in meta.keys() if m.startswith('x-container-meta')])
def agent(): ca.log("Starting!") keystone = client.Client(token=ca.creds['token'], tenant_id=ca.creds['tenantId'], auth_url=ca.creds['identity_url']) object_store_catalog = keystone.service_catalog.get_endpoints()['object-store'] source_endpoint = None for endpoints in object_store_catalog: if endpoints['region'] == ca.conf['region']: source_endpoint = endpoints if not source_endpoint: ca.log_fail("Failing, source region not found in endpoint list.") exit() target_endpoint = None for endpoints in object_store_catalog: if endpoints['region'] == ca.conf['galleryregion']: target_endpoint = endpoints if not source_endpoint: ca.log_fail("Failing, target region not found in endpoint list.") exit() try: container = swiftclient.head_container(target_endpoint['publicURL'],ca.creds['token'], ca.conf['gallerycontainer']) if not '.r:*' in container.get('x-container-read'): ca.warn("Gallery container exists, but may not be publicly readable.","") except: ca.log("Gallery container doesn't exist, creating new publicly readable container.","") swiftclient.put_container(target_endpoint['publicURL'],ca.creds['token'], ca.conf['gallerycontainer'],{"X-Container-Read": ".r:*"}) ca.log("Getting target listing.","") targetlisting = get_swift_container(target_endpoint['publicURL']+"/"+ca.conf['gallerycontainer']+"?prefix="+ca.conf.get('gallerypath'),ca.creds['token']) ca.log("Getting source listing.","") sourcelisting = get_swift_container(source_endpoint['publicURL']+"/"+ca.conf['container']+"?prefix="+ca.conf.get('path'),ca.creds['token']) good_files = re.compile(".*\.(JPG|jpg|JPEG|jpeg|PNG|png)$") something_changed = False # We should add some stuff to clean up paths, ie: ensure they end in a slash. Later. for file in sourcelisting: if good_files.match(file): justfile = file.replace(ca.conf.get("path"), "") (name,ext) = justfile.rsplit(".",1) if not ca.conf.get("gallerypath")+name+"-large."+ext in targetlisting or not ca.conf.get("gallerypath")+name+"-small."+ext in targetlisting: something_changed = True ca.log("Scaling "+justfile+" to smaller sizes.","") rescale( {"url": source_endpoint['publicURL'],"container": ca.conf['container'],"name":ca.conf.get('path')+justfile}, {"url": target_endpoint['publicURL'],"container": ca.conf['gallerycontainer'],"name":ca.conf.get('gallerypath')+name+"-large."+ext}, {"url": target_endpoint['publicURL'],"container": ca.conf['gallerycontainer'],"name":ca.conf.get('gallerypath')+name+"-small."+ext}, ca.creds['token']) targetlisting.append(ca.conf['gallerypath']+name+"-large."+ext) tree = {} subs = {} if something_changed: # Rebuild our templates. for file in sourcelisting: if good_files.match(file): name = file.replace(ca.conf.get("path"), "") path = name.split("/") if len(path) > 1: subpath = "/".join(path[:-1]) if tree.get(subpath): tree[subpath].extend([path[-1]]) else: tree[subpath] = [path[-1]] else: if tree.get(""): tree[""].extend(path) else: tree[""] = path if len(path) > 1: level_above = "/".join(path[0:-2]) if subs.get(level_above): subs[level_above].add(path[-2]) else: subs[level_above] = set([path[-2]]) head = """ <head><title>%s Gallery</title> <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-combined.min.css" rel="stylesheet"> <link href="https://region-a.geo-1.objects.hpcloudsvc.com:443/v1.0/16026287679679/testcontainer/colorbox/colorbox.css" rel="stylesheet"> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js"></script> <script src="http://cdn.jsdelivr.net/colorbox/1.3.19.3/jquery.colorbox-min.js"></script> <script> $(document).ready(function(){ $('a.gallery').colorbox({ rel:'group1' }); }); </script> <style> .thumbnail { height: 150px, width: 150px } </style> </head> <body> <div class="container"> <h1>%s Gallery</h1> """ sublist = """ <h2>Sub-Galleries</h2> <ul class="nav nav-tabs nav-stacked"> """ back_up = """ <ul class="nav nav-tabs nav-stacked"> <li><a href="../">Back to %s</a></li> </ul> """ gallery_top = """ <ul class="thumbnails"> """ gallery_bottom = """ </ul> """ footer = """ </div> </body> """ for name, template in tree.items(): ca.log("Writing gallery template for "+name,"") pretty_name = name.split("/")[-1] html = head % (pretty_name,pretty_name) if name: if len(name.split("/")) == 1: html += back_up % ("Home") elif len(name.split("/")) > 1: html += back_up % (name.split("/")[-2]) if subs.get(name): html += sublist for subpath in subs[name]: html += '<li><a href="%s/">%s</a></li>\n' % (subpath, subpath) html += "</ul>\n" html += gallery_top for file in template: (filename,extension) = file.rsplit(".",1) html += "<li class='span3'>\n<a href='%s' class='gallery thumbnail'><img src='%s'></a></li>\n" % (filename+"-large."+extension,filename+"-small."+extension) html += gallery_bottom html += footer filename = name if filename and filename[-1] != '/': filename = filename +"/" swiftclient.put_object(target_endpoint['publicURL']+"/"+ca.conf['gallerycontainer']+"/"+ca.conf.get('gallerypath')+filename, contents=html, content_type="text/html", token=ca.creds['token']) ca.log("Gallery updated at "+target_endpoint['publicURL']+"/"+ca.conf['gallerycontainer']+"/"+ca.conf.get('gallerypath'),"") else: ca.log("No new files found.","")
def __init__(self, **settings): # check if some of the settings provided as class attributes # should be overwritten for name, value in settings.items(): if hasattr(self, name): setattr(self, name, value) validate_settings(self) self.last_headers_name = None self.last_headers_value = None self.os_options = { 'tenant_id': self.tenant_id, 'tenant_name': self.tenant_name, 'user_domain_id': self.user_domain_id, 'user_domain_name': self.user_domain_name, 'project_domain_id': self.project_domain_id, 'project_domain_name': self.project_domain_name } self.os_options.update(self.os_extra_options) # Get authentication token self.storage_url, self.token = swiftclient.get_auth( self.api_auth_url, self.api_username, self.api_key, auth_version=self.auth_version, os_options=self.os_options) self.http_conn = swiftclient.http_connection(self.storage_url) # Check container try: swiftclient.head_container(self.storage_url, self.token, self.container_name, http_conn=self.http_conn) except swiftclient.ClientException: headers = {} if self.auto_create_container: if self.auto_create_container_public: headers['X-Container-Read'] = '.r:*' if self.auto_create_container_allow_orgin: headers['X-Container-Meta-Access-Control-Allow-Origin'] = \ self.auto_create_container_allow_orgin swiftclient.put_container(self.storage_url, self.token, self.container_name, http_conn=self.http_conn, headers=headers) else: raise ImproperlyConfigured( "Container %s does not exist." % self.container_name) if self.auto_base_url: # Derive a base URL based on the authentication information from # the server, optionally overriding the protocol, host/port and # potentially adding a path fragment before the auth information. self.base_url = self.storage_url + '/' if self.override_base_url is not None: # override the protocol and host, append any path fragments split_derived = urlparse.urlsplit(self.base_url) split_override = urlparse.urlsplit(self.override_base_url) split_result = [''] * 5 split_result[0:2] = split_override[0:2] split_result[2] = (split_override[2] + split_derived[2] ).replace('//', '/') self.base_url = urlparse.urlunsplit(split_result) self.base_url = urlparse.urljoin(self.base_url, self.container_name) self.base_url += '/' else: self.base_url = self.override_base_url
def agent(): ca.log("Starting!") keystone = client.Client(token=ca.creds['token'], tenant_id=ca.creds['tenantId'], auth_url=ca.creds['identity_url']) object_store_catalog = keystone.service_catalog.get_endpoints( )['object-store'] source_endpoint = None for endpoints in object_store_catalog: if endpoints['region'] == ca.conf['region']: source_endpoint = endpoints if not source_endpoint: ca.log_fail("Failing, source region not found in endpoint list.") exit() target_endpoint = None for endpoints in object_store_catalog: if endpoints['region'] == ca.conf['galleryregion']: target_endpoint = endpoints if not source_endpoint: ca.log_fail("Failing, target region not found in endpoint list.") exit() try: container = swiftclient.head_container(target_endpoint['publicURL'], ca.creds['token'], ca.conf['gallerycontainer']) if not '.r:*' in container.get('x-container-read'): ca.warn( "Gallery container exists, but may not be publicly readable.", "") except: ca.log( "Gallery container doesn't exist, creating new publicly readable container.", "") swiftclient.put_container(target_endpoint['publicURL'], ca.creds['token'], ca.conf['gallerycontainer'], {"X-Container-Read": ".r:*"}) ca.log("Getting target listing.", "") targetlisting = get_swift_container( target_endpoint['publicURL'] + "/" + ca.conf['gallerycontainer'] + "?prefix=" + ca.conf.get('gallerypath'), ca.creds['token']) ca.log("Getting source listing.", "") sourcelisting = get_swift_container( source_endpoint['publicURL'] + "/" + ca.conf['container'] + "?prefix=" + ca.conf.get('path'), ca.creds['token']) good_files = re.compile(".*\.(JPG|jpg|JPEG|jpeg|PNG|png)$") something_changed = False # We should add some stuff to clean up paths, ie: ensure they end in a slash. Later. for file in sourcelisting: if good_files.match(file): justfile = file.replace(ca.conf.get("path"), "") (name, ext) = justfile.rsplit(".", 1) if not ca.conf.get( "gallerypath" ) + name + "-large." + ext in targetlisting or not ca.conf.get( "gallerypath") + name + "-small." + ext in targetlisting: something_changed = True ca.log("Scaling " + justfile + " to smaller sizes.", "") rescale( { "url": source_endpoint['publicURL'], "container": ca.conf['container'], "name": ca.conf.get('path') + justfile }, { "url": target_endpoint['publicURL'], "container": ca.conf['gallerycontainer'], "name": ca.conf.get('gallerypath') + name + "-large." + ext }, { "url": target_endpoint['publicURL'], "container": ca.conf['gallerycontainer'], "name": ca.conf.get('gallerypath') + name + "-small." + ext }, ca.creds['token']) targetlisting.append(ca.conf['gallerypath'] + name + "-large." + ext) tree = {} subs = {} if something_changed: # Rebuild our templates. for file in sourcelisting: if good_files.match(file): name = file.replace(ca.conf.get("path"), "") path = name.split("/") if len(path) > 1: subpath = "/".join(path[:-1]) if tree.get(subpath): tree[subpath].extend([path[-1]]) else: tree[subpath] = [path[-1]] else: if tree.get(""): tree[""].extend(path) else: tree[""] = path if len(path) > 1: level_above = "/".join(path[0:-2]) if subs.get(level_above): subs[level_above].add(path[-2]) else: subs[level_above] = set([path[-2]]) head = """ <head><title>%s Gallery</title> <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/css/bootstrap-combined.min.css" rel="stylesheet"> <link href="https://region-a.geo-1.objects.hpcloudsvc.com:443/v1.0/16026287679679/testcontainer/colorbox/colorbox.css" rel="stylesheet"> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script> <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.1.1/js/bootstrap.min.js"></script> <script src="http://cdn.jsdelivr.net/colorbox/1.3.19.3/jquery.colorbox-min.js"></script> <script> $(document).ready(function(){ $('a.gallery').colorbox({ rel:'group1' }); }); </script> <style> .thumbnail { height: 150px, width: 150px } </style> </head> <body> <div class="container"> <h1>%s Gallery</h1> """ sublist = """ <h2>Sub-Galleries</h2> <ul class="nav nav-tabs nav-stacked"> """ back_up = """ <ul class="nav nav-tabs nav-stacked"> <li><a href="../">Back to %s</a></li> </ul> """ gallery_top = """ <ul class="thumbnails"> """ gallery_bottom = """ </ul> """ footer = """ </div> </body> """ for name, template in tree.items(): ca.log("Writing gallery template for " + name, "") pretty_name = name.split("/")[-1] html = head % (pretty_name, pretty_name) if name: if len(name.split("/")) == 1: html += back_up % ("Home") elif len(name.split("/")) > 1: html += back_up % (name.split("/")[-2]) if subs.get(name): html += sublist for subpath in subs[name]: html += '<li><a href="%s/">%s</a></li>\n' % (subpath, subpath) html += "</ul>\n" html += gallery_top for file in template: (filename, extension) = file.rsplit(".", 1) html += "<li class='span3'>\n<a href='%s' class='gallery thumbnail'><img src='%s'></a></li>\n" % ( filename + "-large." + extension, filename + "-small." + extension) html += gallery_bottom html += footer filename = name if filename and filename[-1] != '/': filename = filename + "/" swiftclient.put_object(target_endpoint['publicURL'] + "/" + ca.conf['gallerycontainer'] + "/" + ca.conf.get('gallerypath') + filename, contents=html, content_type="text/html", token=ca.creds['token']) ca.log( "Gallery updated at " + target_endpoint['publicURL'] + "/" + ca.conf['gallerycontainer'] + "/" + ca.conf.get('gallerypath'), "") else: ca.log("No new files found.", "")