Merge branch 'master' of github.com:open-cloud/xos
diff --git a/README.md b/README.md
index 7bed9c5..54c4c55 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
 http://guide.xosproject.org. The "Developer Guide" at that URL is
 especially helpful, although it isn't perfectly sync'ed with master. 
 Additional design notes, presentations, and other collateral are 
-also available at http://xosproject.org and http://cord.onosproject.org.
+also available at http://xosproject.org and http://opencord.org.
 
 The best way to get started is to look at the collection of
 canned configurations in `xos/configurations/`. The `cord` 
diff --git a/containers/elk/README.md b/containers/elk/README.md
index 9c214e7..676e718 100644
--- a/containers/elk/README.md
+++ b/containers/elk/README.md
@@ -41,6 +41,10 @@
 
 #### Logstash-forwarder
 
+The logstash-forwarder container is configured to mount the /var/log/ directory of the host machine, which means all files in /var/log are visible to the container. Modify the "files" section conf/config.json to include the files you want logstash-forwarder to handle. 
+
+You can modify the mount options in the Makefile if you need to access files that live in a directory other than /var/log/.
+
 To build the Loststash-forwarder container
 
 ```
diff --git a/xos/configurations/acord/Makefile b/xos/configurations/acord/Makefile
index 6d5a04f..b5b93fa 100644
--- a/xos/configurations/acord/Makefile
+++ b/xos/configurations/acord/Makefile
@@ -83,7 +83,7 @@
 	make -C ../../../containers/synchronizer
 
 devstack_images:
-	bash -c "source ../setup/admin-openrc.sh; glance image-show ceilometer-trusty-server-multi-nic || ! mkdir -p /opt/stack/images || ! wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.qcow2 -P /opt/stack/images || glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file /opt/stack/images/ceilometer-trusty-server-multi-nic.qcow2 --container-format bare"
+	bash -c "source ../setup/admin-openrc.sh; glance image-show ceilometer-trusty-server-multi-nic || ! mkdir -p /opt/stack/images || ! wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P /opt/stack/images || glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file /opt/stack/images/ceilometer-trusty-server-multi-nic.compressed.qcow2 --container-format bare"
 
 cloudlab_ceilometer_custom_images:
-	bash -c "source ../setup/admin-openrc.sh; glance image-show ceilometer-trusty-server-multi-nic || ! mkdir -p /tmp/images || ! wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.qcow2 -P /tmp/images || glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file /tmp/images/ceilometer-trusty-server-multi-nic.qcow2 --container-format bare"
+	bash -c "source ../setup/admin-openrc.sh; glance image-show ceilometer-trusty-server-multi-nic || if test -f /proj/xos-PG0/images/ceilometer-trusty-server-multi-nic.compressed.qcow2 ; then glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file /proj/xos-PG0/images/ceilometer-trusty-server-multi-nic.compressed.qcow2 --container-format bare ; else mkdir -p /tmp/images && wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P /tmp/images && glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file /tmp/images/ceilometer-trusty-server-multi-nic.compressed.qcow2 --container-format bare ; fi "
diff --git a/xos/configurations/common/devstack/local.conf b/xos/configurations/common/devstack/local.conf
index 632ed1b..ea70675 100644
--- a/xos/configurations/common/devstack/local.conf
+++ b/xos/configurations/common/devstack/local.conf
@@ -3,7 +3,7 @@
 
 DOWNLOAD_DEFAULT_IMAGES=false
 IMAGE_URLS="http://www.planet-lab.org/cord/trusty-server-multi-nic.img,"
-IMAGE_URLS+="http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.qcow2"
+#IMAGE_URLS+="http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2"
 LIBVIRT_FIREWALL_DRIVER=nova.virt.firewall.NoopFirewallDriver
 # Append the git branch name if you wish to download ceilometer from a specific branch
 enable_plugin ceilometer https://git.openstack.org/openstack/ceilometer 
diff --git a/xos/configurations/cord-pod/Makefile b/xos/configurations/cord-pod/Makefile
index 592f579..2d869a4 100644
--- a/xos/configurations/cord-pod/Makefile
+++ b/xos/configurations/cord-pod/Makefile
@@ -43,7 +43,7 @@
 	bash -c "source ./admin-openrc.sh; nova list --all-tenants; neutron net-list"
 
 ceilometer_custom_images:
-	bash -c "source ./admin-openrc.sh; glance image-show ceilometer-trusty-server-multi-nic || ! mkdir -p ./images || ! wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.qcow2 -P ./images || glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file ./images/ceilometer-trusty-server-multi-nic.qcow2 --container-format bare"
+	bash -c "source ./admin-openrc.sh; glance image-show ceilometer-trusty-server-multi-nic || ! mkdir -p ./images || ! wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P ./images || glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file ./images/ceilometer-trusty-server-multi-nic.compressed.qcow2 --container-format bare"
 
 .PHONY: local_containers
 local_containers:
diff --git a/xos/configurations/cord-pod/cdn/README.md b/xos/configurations/cord-pod/cdn/README.md
index af5b38d..7517638 100644
--- a/xos/configurations/cord-pod/cdn/README.md
+++ b/xos/configurations/cord-pod/cdn/README.md
@@ -61,6 +61,7 @@
 * Second, make sure cdn_enable bit is set in CordSubscriber object for your vSG.
 * curl -L -vvvv http://downloads.onosproject.org/vm/onos-tutorial-1.1.0r220-ovf.zip > /dev/null
 * curl -L -vvvv http://onlab.vicci.org/onos-videos/Nov-planning-day1/Day1+00+Bill+-+Community+Growth.mp4 > /dev/null
+* curl -L -vvvv http://downloads.onosproject.org/release/onos-1.2.0.zip > /dev/null
 
 ## Restart CDN after power-down
 
diff --git a/xos/configurations/cord/Makefile b/xos/configurations/cord/Makefile
index 9fee5f8..1e53e79 100644
--- a/xos/configurations/cord/Makefile
+++ b/xos/configurations/cord/Makefile
@@ -96,4 +96,4 @@
 	sudo pip install httpie --upgrade
 
 cloudlab_ceilometer_custom_images:
-	bash -c "source ../setup/admin-openrc.sh; glance image-show ceilometer-trusty-server-multi-nic || ! mkdir -p /tmp/images || ! wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.qcow2 -P /tmp/images || glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file /tmp/images/ceilometer-trusty-server-multi-nic.qcow2 --container-format bare"
+	bash -c "source ../setup/admin-openrc.sh; glance image-show ceilometer-trusty-server-multi-nic || if test -f /proj/xos-PG0/images/ceilometer-trusty-server-multi-nic.compressed.qcow2 ; then glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file /proj/xos-PG0/images/ceilometer-trusty-server-multi-nic.compressed.qcow2 --container-format bare ; else mkdir -p /tmp/images && wget http://www.vicci.org/cord/ceilometer-trusty-server-multi-nic.compressed.qcow2 -P /tmp/images && glance image-create --name ceilometer-trusty-server-multi-nic --disk-format qcow2 --file /tmp/images/ceilometer-trusty-server-multi-nic.compressed.qcow2 --container-format bare ; fi "
diff --git a/xos/core/admin.py b/xos/core/admin.py
index 44fa06c..0608e4e 100644
--- a/xos/core/admin.py
+++ b/xos/core/admin.py
@@ -1406,7 +1406,8 @@
 
     def render_change_form(self, request, context, add=False, change=False, form_url='', obj=None):
         deployment_nodes = []
-        for node in Node.objects.all():
+#        for node in Node.objects.all():
+        for node in Node.objects.order_by("name"):
             deployment_nodes.append( (node.site_deployment.deployment.id, node.id, node.name) )
 
         deployment_flavors = []
diff --git a/xos/core/models/__init__.py b/xos/core/models/__init__.py
index 2ee6b94..6fad0f1 100644
--- a/xos/core/models/__init__.py
+++ b/xos/core/models/__init__.py
@@ -5,7 +5,7 @@
 from .service import ServiceAttribute, TenantAttribute, ServiceRole
 from .tag import Tag
 from .role import Role
-from .site import Site, Deployment, DeploymentRole, DeploymentPrivilege, Controller, ControllerRole, ControllerSite, SiteDeployment
+from .site import Site, Deployment, DeploymentRole, DeploymentPrivilege, Controller, ControllerRole, ControllerSite, SiteDeployment,Diag
 from .dashboard import DashboardView, ControllerDashboardView
 from .user import User, UserDashboardView
 from .serviceclass import ServiceClass
diff --git a/xos/core/models/site.py b/xos/core/models/site.py
index b98c40a..77b96ac 100644
--- a/xos/core/models/site.py
+++ b/xos/core/models/site.py
@@ -312,9 +312,19 @@
     tenant_id = StrippedCharField(null=True, blank=True, max_length=200, db_index=True, help_text="Keystone tenant id")
 
     def delete(self, *args, **kwds):
-        pdb.set_trace()
         super(ControllerSite, self).delete(*args, **kwds)
 
     
     class Meta:
         unique_together = ('site', 'controller') 
+
+class Diag(PlCoreBase):
+    name = StrippedCharField(max_length=200, help_text="Name of the synchronizer")
+    
+    @property
+    def enacted(self):
+        return None
+
+    @enacted.setter
+    def enacted(self, value):
+        pass # Ignore sets, Diag objects are always pending.
diff --git a/xos/core/views/observer.py b/xos/core/views/observer.py
index 3aabc4a..77f1d1b 100644
--- a/xos/core/views/observer.py
+++ b/xos/core/views/observer.py
@@ -1,16 +1,23 @@
 from django.http import HttpResponse
 from core.models import *
+from xos.config import Config
 import json
 import os
 import time
 
 def Observer(request):
-    if not os.path.exists('/tmp/observer_last_run'):
+    try:
+        observer_name = Config().observer_name
+    except AttributeError:
+        observer_name = ''
+
+    diag = Diag.objects.filter(name=observer_name).first()
+    if not diag:
         return HttpResponse(json.dumps({"health": ":-X", "time": time.time(), "comp": 0}))
 
     t = time.time()
-    status_str = open('/tmp/observer_last_run','r').read()
-    d = json.loads(status_str)
+    
+    d = json.loads(diag.backend_register)
     comp = d['last_run'] + d['last_duration']*2 + 300
     if comp>t:
         d['health'] = ':-)'
diff --git a/xos/synchronizers/base/event_loop.py b/xos/synchronizers/base/event_loop.py
index c1b9cda..f224380 100644
--- a/xos/synchronizers/base/event_loop.py
+++ b/xos/synchronizers/base/event_loop.py
@@ -520,7 +520,15 @@
                         self.save_run_times()
 
                         loop_end = time.time()
-                        open('/tmp/%sobserver_last_run'%self.observer_name,'w').write(json.dumps({'last_run': loop_end, 'last_duration':loop_end - loop_start}))
+
+                        diag = Diag.objects.filter(name=Config().observer_name).first()
+                        if (diag):
+                            br_str = diag.backend_register
+                            br = json.loads(br_str)
+                            br['last_run'] = loop_end
+                            br['last_duration'] = loop_end - loop_start
+                            diag.backend_register = json.dumps(br)
+                            diag.save() 
                 except Exception, e:
                         logger.error('Core error. This seems like a misconfiguration or bug: %r. This error will not be relayed to the user!' % e)
                         logger.log_exc("Exception in observer run loop")
diff --git a/xos/synchronizers/base/syncstep.py b/xos/synchronizers/base/syncstep.py
index 54c4b89..e6b8d55 100644
--- a/xos/synchronizers/base/syncstep.py
+++ b/xos/synchronizers/base/syncstep.py
@@ -227,8 +227,9 @@
                         self.delete_record(o)
                         o.delete(purge=True)
                     else:
+                        new_enacted = datetime.now() # Is this the same timezone? XXX
                         self.sync_record(o)
-                        o.enacted = datetime.now() # Is this the same timezone? XXX
+                        o.enacted = new_enacted
                         scratchpad = {'next_run':0, 'exponent':0, 'last_success':time.time()}
                         o.backend_register = json.dumps(scratchpad)
                         o.backend_status = "1 - OK"
diff --git a/xos/synchronizers/model_policy.py b/xos/synchronizers/model_policy.py
index b8fdd5d..d0bbbb1 100644
--- a/xos/synchronizers/model_policy.py
+++ b/xos/synchronizers/model_policy.py
@@ -52,7 +52,7 @@
     return
 
 
-@atomic
+#@atomic
 def execute_model_policy(instance, deleted):
     # Automatic dirtying
     if (instance in bad_instances):