Send swift upload instructions to workers

Have zuul send signed credentials as part of the job for workers to
consume and upload assets to a defined location.

Zuul currently doesn't care about logs however this change will
suggest a LOG_PATH to builders as a unqiue destination prefix
allowing zuul to know preemptively the destination.
The workers are still required to send a URL of the final location.

Change-Id: I042cdd2dd2407f381cafcabc5c6b83d9b9a9eb00
diff --git a/zuul/model.py b/zuul/model.py
index 1a7c421..e2d13c6 100644
--- a/zuul/model.py
+++ b/zuul/model.py
@@ -537,6 +537,7 @@
         self._branches = []
         self.files = []
         self._files = []
+        self.swift = {}
 
     def __str__(self):
         return self.name
@@ -561,6 +562,8 @@
         if other.files:
             self.files = other.files[:]
             self._files = other._files[:]
+        if other.swift:
+            self.swift.update(other.swift)
         self.hold_following_changes = other.hold_following_changes
         self.voting = other.voting
 
@@ -763,6 +766,16 @@
     def __init__(self, project):
         self.project = project
 
+    def getBasePath(self):
+        base_path = ''
+        if hasattr(self, 'refspec'):
+            base_path = "%s/%s/%s" % (
+                self.number[-2:], self.number, self.patchset)
+        elif hasattr(self, 'ref'):
+            base_path = "%s/%s" % (self.newrev[:2], self.newrev)
+
+        return base_path
+
     def equals(self, other):
         raise NotImplementedError()