Projects
Kolab:Winterfell
bonnie
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 8
View file
bonnie.spec
Changed
@@ -17,7 +17,7 @@ %global bonnie_group_id 415 Name: bonnie -Version: 0.3.6 +Version: 0.3.7 Release: 1%{?dist} Summary: Bonnie for Kolab Groupware @@ -366,7 +366,8 @@ %defattr(-,root,root,-) %changelog -* Fri Jun 22 2018 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.3.6-1 +* Fri Jun 22 2018 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.3.7-1 +- Don't run out of fields - Fix storing user data to the side * Sun Jun 17 2018 Jeroen van Meeuwen <vanmeeuwen@kolabsys.com> - 0.3.4-1
View file
bonnie-0.3.6.tar.gz/bonnie/utils.py -> bonnie-0.3.7.tar.gz/bonnie/utils.py
Changed
@@ -83,6 +83,18 @@ (key,val) = p.split('=', 2) result[key] = urllib.unquote(val) + if result['user'] is None: + # Extract the user from path + if result['path'].startswith('user/'): + username = result['path'].split('/')[1] + + result['user'] = username + + if '@' in result['path']: + domain = '%s' % (result['path'].split('@')[1]) + + result['user'] = '%s@%s' % (username, domain) + return result
View file
bonnie-0.3.6.tar.gz/bonnie/worker/handlers/mailboxbase.py -> bonnie-0.3.7.tar.gz/bonnie/worker/handlers/mailboxbase.py
Changed
@@ -35,12 +35,19 @@ (notification, jobs) = super(MailboxHandlerBase, self).run(notification) # mailbox notifications require metadata - if not notification.has_key('metadata'): + if 'metadata' not in notification: jobs.append(b"GETMETADATA") return (notification, jobs) # extract uniqueid from metadata -> triggers the storage module - if notification['metadata'].has_key('/shared/vendor/cmu/cyrus-imapd/uniqueid'): - notification['folder_uniqueid'] = notification['metadata']['/shared/vendor/cmu/cyrus-imapd/uniqueid'] + if 'folder_uniqueid' not in notification: + ann_uniqueid = '/shared/vendor/cmu/cyrus-imapd/uniqueid' + + if ann_uniqueid in notification['metadata']: + folder_uniqueid = notification['metadata'][ann_uniqueid] + notification['folder_uniqueid'] = folder_uniqueid + del folder_uniqueid + + del ann_uniqueid return (notification, jobs)
View file
bonnie-0.3.6.tar.gz/bonnie/worker/storage/elasticsearch_storage.py -> bonnie-0.3.7.tar.gz/bonnie/worker/storage/elasticsearch_storage.py
Changed
@@ -410,6 +410,8 @@ including the computation of a unique identifier which is a checksum of the (relevant) folder properties. """ + log.debug('notification_to_folder on %r' % (notification), level=8) + # split the uri parameter into useful parts uri = parse_imap_uri(notification[attrib]) @@ -436,24 +438,34 @@ notification[attrib] ).hexdigest() + folder_type = 'mail' + + ann_folder_type = '/shared/vendor/kolab/folder-type' + if ann_folder_type in notification['metadata']: + folder_type = notification['metadata'][ann_folder_type] + + if 'user' in uri and uri['user'] is not None: + owner = self.resolve_username(uri['user'], force=True) + else: + owner = None + body = { '@version': bonnie.API_VERSION, '@timestamp': datetime.datetime.now( tzutc() ).strftime("%Y-%m-%dT%H:%M:%S.%fZ"), - 'uniqueid': notification['folder_uniqueid'], - 'metadata': notification['metadata'], - 'acl': dict( + 'metadata': list(set(k, v for k, v in notification['metadata']), + 'acl': list(set( ( self.resolve_username(k, force=True), v ) for k, v in notification['acl'].iteritems() ), - 'type': notification['metadata']['/shared/vendor/kolab/folder-type'] if '/shared/vendor/kolab/folder-type' in notification['metadata'] else 'mail', + 'folder_type': folder_type, - 'owner': uri['user'] + '@' + uri['domain'] if uri['user'] is not None else 'nobody', + 'owner': owner, 'server': uri['host'], 'name': uri['path'], 'uri': folder_uri, @@ -466,27 +478,7 @@ '/shared/vendor/cmu/cyrus-imapd/size' ] - signature = { - '@version': bonnie.API_VERSION, - 'owner': body['owner'], - 'server': body['server'], - 'uniqueid': notification['folder_uniqueid'], - 'metadata': [ - (k, v) for k, v in sorted(body['metadata'].iteritems()) if k not in ignore_metadata - ], - - 'acl': [ - (k, v) for k, v in sorted(body['acl'].iteritems()) - ], - } - - serialized = ";".join( - "%s:%s" % (k, v) for k, v in sorted(signature.iteritems()) - ) - - folder_id = hashlib.md5(serialized).hexdigest() - - return dict(id=folder_id, body=body) + return dict(id=notification['folder_uniqueid'], body=body) def resolve_folder_uri(self, notification, attrib='uri'): """ @@ -514,12 +506,12 @@ return (notification, []) # mailbox resolving requires metadata - if not notification.has_key('metadata'): + if 'metadata' not in notification: log.debug("Adding GETMETADATA job", level=8) jobs.append(b"GETMETADATA") # before creating a folder entry, we should collect folder ACLs - if not notification.has_key('acl'): + if 'acl' not in notification: log.debug("Adding GETACL", level=8) jobs.append(b"GETACL") @@ -540,7 +532,7 @@ index=self.folders_index, doctype=self.folders_doctype, key=folder['id'], - stored_fields='uniqueid,name' + stored_fields='name' ) # create an entry for the referenced imap folder @@ -563,7 +555,7 @@ folder = None # update entry if name changed - elif folder['body']['uniqueid'] == existing['uniqueid'] and \ + elif folder['_id'] == existing['_id'] and \ not folder['body']['name'] == existing['name']: try:
View file
bonnie-0.3.6.tar.gz/broker.py -> bonnie-0.3.7.tar.gz/broker.py
Changed
@@ -19,6 +19,10 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # +import sys + +sys.path.insert(0, '.') + from bonnie.broker import BonnieBroker if __name__ == "__main__":
View file
bonnie-0.3.6.tar.gz/collector.py -> bonnie-0.3.7.tar.gz/collector.py
Changed
@@ -19,6 +19,10 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # +import sys + +sys.path.insert(0, '.') + from bonnie.collector import BonnieCollector if __name__ == "__main__":
View file
bonnie-0.3.6.tar.gz/dealer-async.py -> bonnie-0.3.7.tar.gz/dealer-async.py
Changed
@@ -22,6 +22,8 @@ import os import sys +sys.path.insert(0, '.') + from bonnie.dealer import BonnieDealer if __name__ == "__main__":
View file
bonnie-0.3.6.tar.gz/dealer-sync.py -> bonnie-0.3.7.tar.gz/dealer-sync.py
Changed
@@ -19,9 +19,10 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # -import os import sys +sys.path.insert(0, '.') + from bonnie.dealer import BonnieDealer if __name__ == "__main__": @@ -30,9 +31,3 @@ dealer = BonnieDealer() dealer.run(notification) - -# newpid = os.fork() -# -# if newpid == 0: -# dealer = BonnieDealer() -# dealer.run(notification)
View file
bonnie-0.3.6.tar.gz/worker.py -> bonnie-0.3.7.tar.gz/worker.py
Changed
@@ -19,6 +19,10 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # +import sys + +sys.path.insert(0, '.') + from bonnie.worker import BonnieWorker if __name__ == "__main__":
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.