Merge branch 'master' of github.com:open-cloud/xos
diff --git a/xos/configurations/cord/README-VTN.md b/xos/configurations/cord/README-VTN.md
index d27d1d1..b51bae7 100644
--- a/xos/configurations/cord/README-VTN.md
+++ b/xos/configurations/cord/README-VTN.md
@@ -88,4 +88,20 @@
 
 * Create an Instance, it should have a Private network, and there should be a tap attached from the instance to br-int
 * Two Instances in the same Slice can talk to one another. They can be on the same machine or different machines.
-* Two Slices can talk to one another if the slices are associated with Services and those Services have a Tenancy relationship between them. Note that 1) The VTN Synchronizer must be running, 2) There must be a Private network with Access=[Direct|Indirect], and 3) The connectivity is unidirection, from subscriber service to provider service.
+* Two Slices can talk to one another if the slices are associated with Services and those Services have a Tenancy relationship between them. Note that 1) The VTN Synchronizer must be running, 2) There must be a Private network with Access=[Direct|Indirect], and 3) The connectivity is unidirectional, from subscriber service to provider service.
+
+Testing service composition
+
+1. Change the private network template's 'Access' field from None to Direct
+2. Create a Service, Service-A
+3. Enter Slice Admin for Slice-1 and assign it to Service-A
+4. Create a Service, Service-B
+5. Enter Slice Admin for Slice-2 and assign it to Service-B
+6. Enter Service Admin for Service-B, Go to Tenancy Tab
+7. In the 'Provided Tenants' section of Service-B, create a Tenant with Subsciber-Service=Serivce-A. 
+8. Start the VTN Observer. It will send a REST request to VTN app.
+9. Launch tcpdump in one of Slice-2's instances
+10. From Slice-1, start pinging the instance in Slice-2 where you launched tcpdump
+11. You should see the pings arrive and responses sent out. Note that the ping responses will not reach Slice-1, since VTN traffic is unidirectional.
+12. Delete the Tenancy relation you created in Step #7. The ping traffic should no longer appear in the tcpdump.
+
diff --git a/xos/core/xoslib/methods/ceilometerview.py b/xos/core/xoslib/methods/ceilometerview.py
index f9f9d89..825cce4 100644
--- a/xos/core/xoslib/methods/ceilometerview.py
+++ b/xos/core/xoslib/methods/ceilometerview.py
@@ -16,7 +16,7 @@
 from django.utils.translation import ugettext_lazy as _
 from django.utils import timezone
 from django.core.exceptions import PermissionDenied
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 
 # This REST API endpoint provides information that the ceilometer view needs to display
 
diff --git a/xos/synchronizers/base/ansible.py b/xos/synchronizers/base/ansible.py
index 94b09bd..fda2300 100644
--- a/xos/synchronizers/base/ansible.py
+++ b/xos/synchronizers/base/ansible.py
@@ -10,7 +10,7 @@
 import traceback
 import subprocess
 from xos.config import Config, XOS_DIR
-from util.logger import observer_logger
+from xos.logger import observer_logger
 
 try:
     step_dir = Config().observer_steps_dir
diff --git a/xos/synchronizers/base/steps/purge_disabled_users.py b/xos/synchronizers/base/steps/purge_disabled_users.py
index 80690b0..0973b8c 100644
--- a/xos/synchronizers/base/steps/purge_disabled_users.py
+++ b/xos/synchronizers/base/steps/purge_disabled_users.py
@@ -5,7 +5,7 @@
 from xos.config import Config
 from synchronizers.base.openstacksyncstep import OpenStackSyncStep
 from core.models.user import User
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 
 class SyncRoles(OpenStackSyncStep):
     provides=[User]
diff --git a/xos/synchronizers/base/steps/sync_controller_images.py b/xos/synchronizers/base/steps/sync_controller_images.py
index 04908dc..89dc8ae 100644
--- a/xos/synchronizers/base/steps/sync_controller_images.py
+++ b/xos/synchronizers/base/steps/sync_controller_images.py
@@ -7,7 +7,7 @@
 from observer.syncstep import *
 from core.models import Controller
 from core.models import Image, ControllerImages
-from util.logger import observer_logger as logger 
+from xos.logger import observer_logger as logger 
 from observer.ansible import *
 import json
 
diff --git a/xos/synchronizers/base/steps/sync_controller_networks.py b/xos/synchronizers/base/steps/sync_controller_networks.py
index 5b1ca20..6f80757 100644
--- a/xos/synchronizers/base/steps/sync_controller_networks.py
+++ b/xos/synchronizers/base/steps/sync_controller_networks.py
@@ -9,7 +9,7 @@
 from core.models.network import *
 from core.models.slice import *
 from core.models.instance import Instance
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 from observer.ansible import *
 from openstack.driver import OpenStackDriver
 from xos.config import Config
diff --git a/xos/synchronizers/base/steps/sync_controller_site_privileges.py b/xos/synchronizers/base/steps/sync_controller_site_privileges.py
index 5688932..640f161 100644
--- a/xos/synchronizers/base/steps/sync_controller_site_privileges.py
+++ b/xos/synchronizers/base/steps/sync_controller_site_privileges.py
@@ -8,7 +8,7 @@
 from core.models.site import Controller, SitePrivilege 
 from core.models.user import User
 from core.models.controlleruser import ControllerUser, ControllerSitePrivilege
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 from observer.ansible import *
 import json
 
diff --git a/xos/synchronizers/base/steps/sync_controller_sites.py b/xos/synchronizers/base/steps/sync_controller_sites.py
index 614d435..fcc85b1 100644
--- a/xos/synchronizers/base/steps/sync_controller_sites.py
+++ b/xos/synchronizers/base/steps/sync_controller_sites.py
@@ -6,7 +6,7 @@
 from core.models.site import *
 from observer.syncstep import *
 from observer.ansible import *
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 import json
 
 class SyncControllerSites(OpenStackSyncStep):
diff --git a/xos/synchronizers/base/steps/sync_controller_slice_privileges.py b/xos/synchronizers/base/steps/sync_controller_slice_privileges.py
index c3d9ce4..452aec0 100644
--- a/xos/synchronizers/base/steps/sync_controller_slice_privileges.py
+++ b/xos/synchronizers/base/steps/sync_controller_slice_privileges.py
@@ -9,7 +9,7 @@
 from core.models.user import User
 from core.models.controlleruser import ControllerUser, ControllerSlicePrivilege
 from observer.ansible import *
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 import json
 
 class SyncControllerSlicePrivileges(OpenStackSyncStep):
diff --git a/xos/synchronizers/base/steps/sync_controller_slices.py b/xos/synchronizers/base/steps/sync_controller_slices.py
index aee2a0a..4c82eb6 100644
--- a/xos/synchronizers/base/steps/sync_controller_slices.py
+++ b/xos/synchronizers/base/steps/sync_controller_slices.py
@@ -9,7 +9,7 @@
 from core.models import *
 from observer.ansible import *
 from openstack.driver import OpenStackDriver
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 import json
 
 class SyncControllerSlices(OpenStackSyncStep):
diff --git a/xos/synchronizers/base/steps/sync_controller_users.py b/xos/synchronizers/base/steps/sync_controller_users.py
index 68faec9..cfab4f5 100644
--- a/xos/synchronizers/base/steps/sync_controller_users.py
+++ b/xos/synchronizers/base/steps/sync_controller_users.py
@@ -9,7 +9,7 @@
 from core.models.user import User
 from core.models.controlleruser import ControllerUser
 from observer.ansible import *
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 import json
 
 class SyncControllerUsers(OpenStackSyncStep):
diff --git a/xos/synchronizers/base/steps/sync_images.py b/xos/synchronizers/base/steps/sync_images.py
index 40c6447..8049ac1 100644
--- a/xos/synchronizers/base/steps/sync_images.py
+++ b/xos/synchronizers/base/steps/sync_images.py
@@ -4,7 +4,7 @@
 from xos.config import Config
 from synchronizers.base.openstacksyncstep import OpenStackSyncStep
 from core.models.image import Image
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 
 class SyncImages(OpenStackSyncStep):
     provides=[Image]
diff --git a/xos/synchronizers/base/steps/sync_instances.py b/xos/synchronizers/base/steps/sync_instances.py
index e336279..5e0cc64 100644
--- a/xos/synchronizers/base/steps/sync_instances.py
+++ b/xos/synchronizers/base/steps/sync_instances.py
@@ -10,7 +10,7 @@
 from core.models.network import Network, NetworkSlice, ControllerNetwork
 from observer.ansible import *
 from observer.syncstep import *
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 
 def escape(s):
     s = s.replace('\n',r'\n').replace('"',r'\"')
diff --git a/xos/synchronizers/base/steps/sync_object.py b/xos/synchronizers/base/steps/sync_object.py
index dc117d6..1e07cd2 100644
--- a/xos/synchronizers/base/steps/sync_object.py
+++ b/xos/synchronizers/base/steps/sync_object.py
@@ -8,7 +8,7 @@
 from core.models import *
 from observer.ansible import *
 from openstack.driver import OpenStackDriver
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 import json
 
 class SyncObject(OpenStackSyncStep):
diff --git a/xos/synchronizers/base/steps/sync_ports.py b/xos/synchronizers/base/steps/sync_ports.py
index 37b780a..21376e5 100644
--- a/xos/synchronizers/base/steps/sync_ports.py
+++ b/xos/synchronizers/base/steps/sync_ports.py
@@ -5,7 +5,7 @@
 from synchronizers.base.openstacksyncstep import OpenStackSyncStep
 from core.models import Controller
 from core.models.network import *
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 
 class SyncPorts(OpenStackSyncStep):
     requested_interval = 0 # 3600
diff --git a/xos/synchronizers/base/steps/sync_roles.py b/xos/synchronizers/base/steps/sync_roles.py
index e157dc2..e859316 100644
--- a/xos/synchronizers/base/steps/sync_roles.py
+++ b/xos/synchronizers/base/steps/sync_roles.py
@@ -6,7 +6,7 @@
 from core.models.role import Role
 from core.models.site import SiteRole, Controller, ControllerRole
 from core.models.slice import SliceRole
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 
 class SyncRoles(OpenStackSyncStep):
     provides=[Role]
diff --git a/xos/synchronizers/model_policy.py b/xos/synchronizers/model_policy.py
index 2f6d980..6cc2176 100644
--- a/xos/synchronizers/model_policy.py
+++ b/xos/synchronizers/model_policy.py
@@ -3,7 +3,7 @@
 import pdb
 from generator.dependency_walker import *
 from synchronizers.openstack import model_policies
-from util.logger import logger
+from xos.logger import logger
 from datetime import datetime
 import time
 from core.models import *
diff --git a/xos/synchronizers/openstack/ansible.py b/xos/synchronizers/openstack/ansible.py
index 94b09bd..fda2300 100644
--- a/xos/synchronizers/openstack/ansible.py
+++ b/xos/synchronizers/openstack/ansible.py
@@ -10,7 +10,7 @@
 import traceback
 import subprocess
 from xos.config import Config, XOS_DIR
-from util.logger import observer_logger
+from xos.logger import observer_logger
 
 try:
     step_dir = Config().observer_steps_dir
diff --git a/xos/synchronizers/openstack/steps/purge_disabled_users.py b/xos/synchronizers/openstack/steps/purge_disabled_users.py
index 80690b0..0973b8c 100644
--- a/xos/synchronizers/openstack/steps/purge_disabled_users.py
+++ b/xos/synchronizers/openstack/steps/purge_disabled_users.py
@@ -5,7 +5,7 @@
 from xos.config import Config
 from synchronizers.base.openstacksyncstep import OpenStackSyncStep
 from core.models.user import User
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 
 class SyncRoles(OpenStackSyncStep):
     provides=[User]
diff --git a/xos/synchronizers/openstack/steps/sync_controller_images.py b/xos/synchronizers/openstack/steps/sync_controller_images.py
index 04908dc..89dc8ae 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_images.py
+++ b/xos/synchronizers/openstack/steps/sync_controller_images.py
@@ -7,7 +7,7 @@
 from observer.syncstep import *
 from core.models import Controller
 from core.models import Image, ControllerImages
-from util.logger import observer_logger as logger 
+from xos.logger import observer_logger as logger 
 from observer.ansible import *
 import json
 
diff --git a/xos/synchronizers/openstack/steps/sync_controller_networks.py b/xos/synchronizers/openstack/steps/sync_controller_networks.py
index 5b1ca20..6f80757 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_networks.py
+++ b/xos/synchronizers/openstack/steps/sync_controller_networks.py
@@ -9,7 +9,7 @@
 from core.models.network import *
 from core.models.slice import *
 from core.models.instance import Instance
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 from observer.ansible import *
 from openstack.driver import OpenStackDriver
 from xos.config import Config
diff --git a/xos/synchronizers/openstack/steps/sync_controller_site_privileges.py b/xos/synchronizers/openstack/steps/sync_controller_site_privileges.py
index 5688932..640f161 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_site_privileges.py
+++ b/xos/synchronizers/openstack/steps/sync_controller_site_privileges.py
@@ -8,7 +8,7 @@
 from core.models.site import Controller, SitePrivilege 
 from core.models.user import User
 from core.models.controlleruser import ControllerUser, ControllerSitePrivilege
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 from observer.ansible import *
 import json
 
diff --git a/xos/synchronizers/openstack/steps/sync_controller_sites.py b/xos/synchronizers/openstack/steps/sync_controller_sites.py
index 614d435..fcc85b1 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_sites.py
+++ b/xos/synchronizers/openstack/steps/sync_controller_sites.py
@@ -6,7 +6,7 @@
 from core.models.site import *
 from observer.syncstep import *
 from observer.ansible import *
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 import json
 
 class SyncControllerSites(OpenStackSyncStep):
diff --git a/xos/synchronizers/openstack/steps/sync_controller_slice_privileges.py b/xos/synchronizers/openstack/steps/sync_controller_slice_privileges.py
index c3d9ce4..452aec0 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_slice_privileges.py
+++ b/xos/synchronizers/openstack/steps/sync_controller_slice_privileges.py
@@ -9,7 +9,7 @@
 from core.models.user import User
 from core.models.controlleruser import ControllerUser, ControllerSlicePrivilege
 from observer.ansible import *
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 import json
 
 class SyncControllerSlicePrivileges(OpenStackSyncStep):
diff --git a/xos/synchronizers/openstack/steps/sync_controller_slices.py b/xos/synchronizers/openstack/steps/sync_controller_slices.py
index aee2a0a..4c82eb6 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_slices.py
+++ b/xos/synchronizers/openstack/steps/sync_controller_slices.py
@@ -9,7 +9,7 @@
 from core.models import *
 from observer.ansible import *
 from openstack.driver import OpenStackDriver
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 import json
 
 class SyncControllerSlices(OpenStackSyncStep):
diff --git a/xos/synchronizers/openstack/steps/sync_controller_users.py b/xos/synchronizers/openstack/steps/sync_controller_users.py
index 68faec9..cfab4f5 100644
--- a/xos/synchronizers/openstack/steps/sync_controller_users.py
+++ b/xos/synchronizers/openstack/steps/sync_controller_users.py
@@ -9,7 +9,7 @@
 from core.models.user import User
 from core.models.controlleruser import ControllerUser
 from observer.ansible import *
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 import json
 
 class SyncControllerUsers(OpenStackSyncStep):
diff --git a/xos/synchronizers/openstack/steps/sync_images.py b/xos/synchronizers/openstack/steps/sync_images.py
index 40c6447..8049ac1 100644
--- a/xos/synchronizers/openstack/steps/sync_images.py
+++ b/xos/synchronizers/openstack/steps/sync_images.py
@@ -4,7 +4,7 @@
 from xos.config import Config
 from synchronizers.base.openstacksyncstep import OpenStackSyncStep
 from core.models.image import Image
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 
 class SyncImages(OpenStackSyncStep):
     provides=[Image]
diff --git a/xos/synchronizers/openstack/steps/sync_instances.py b/xos/synchronizers/openstack/steps/sync_instances.py
index e336279..5e0cc64 100644
--- a/xos/synchronizers/openstack/steps/sync_instances.py
+++ b/xos/synchronizers/openstack/steps/sync_instances.py
@@ -10,7 +10,7 @@
 from core.models.network import Network, NetworkSlice, ControllerNetwork
 from observer.ansible import *
 from observer.syncstep import *
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 
 def escape(s):
     s = s.replace('\n',r'\n').replace('"',r'\"')
diff --git a/xos/synchronizers/openstack/steps/sync_object.py b/xos/synchronizers/openstack/steps/sync_object.py
index dc117d6..1e07cd2 100644
--- a/xos/synchronizers/openstack/steps/sync_object.py
+++ b/xos/synchronizers/openstack/steps/sync_object.py
@@ -8,7 +8,7 @@
 from core.models import *
 from observer.ansible import *
 from openstack.driver import OpenStackDriver
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 import json
 
 class SyncObject(OpenStackSyncStep):
diff --git a/xos/synchronizers/openstack/steps/sync_ports.py b/xos/synchronizers/openstack/steps/sync_ports.py
index 37b780a..21376e5 100644
--- a/xos/synchronizers/openstack/steps/sync_ports.py
+++ b/xos/synchronizers/openstack/steps/sync_ports.py
@@ -5,7 +5,7 @@
 from synchronizers.base.openstacksyncstep import OpenStackSyncStep
 from core.models import Controller
 from core.models.network import *
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 
 class SyncPorts(OpenStackSyncStep):
     requested_interval = 0 # 3600
diff --git a/xos/synchronizers/openstack/steps/sync_roles.py b/xos/synchronizers/openstack/steps/sync_roles.py
index e157dc2..e859316 100644
--- a/xos/synchronizers/openstack/steps/sync_roles.py
+++ b/xos/synchronizers/openstack/steps/sync_roles.py
@@ -6,7 +6,7 @@
 from core.models.role import Role
 from core.models.site import SiteRole, Controller, ControllerRole
 from core.models.slice import SliceRole
-from util.logger import observer_logger as logger
+from xos.logger import observer_logger as logger
 
 class SyncRoles(OpenStackSyncStep):
     provides=[Role]
diff --git a/xos/util/logger.py b/xos/xos/logger.py
similarity index 100%
rename from xos/util/logger.py
rename to xos/xos/logger.py