CORD-1954: Remove obsolete files;
fix latlng validation;
replace prints with logging

Change-Id: I88d98667839a34f0e6fb3c70369ce20ece80cb04
diff --git a/xos/admin.py b/xos/admin.py
deleted file mode 100755
index 098b1ab..0000000
--- a/xos/admin.py
+++ /dev/null
@@ -1,55 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-# admin.py - vNaaSworkService Django Admin
-
-from core.admin import ReadOnlyAwareAdmin
-from core.admin import XOSBaseAdmin
-from django.contrib import admin
-from django import forms
-
-
-class XOSvNaaSBandwithProfileAdmin(XOSBaseAdmin):
-    verbose_name = "Bandwidth Profile"
-    list_display = ('cbs','ebs','cir','eir','name')
-
-    fields = ('cbs', 'ebs', 'cir', 'eir', 'name')
-
-class XOSvNaaSUNIAdmin(XOSBaseAdmin):
-    verbose_name = "User Network Interface"
-    list_display = ('tenant', 'vlanIds', 'cpe_id', 'latlng', 'name')
-    fields = ('tenant','vlanIds', 'cpe_id', 'latlng', 'name')
-
-class XOSvNaaSEnterpriseLocationAdmin(XOSBaseAdmin):
-    verbose_name = "Enterprise Location"
-    list_display = ('name', 'cord_site_ip', 'cord_site_port', 'cord_site_username', 'cord_site_password', 'cord_site_type')
-    fields = ('name', 'cord_site_ip', 'cord_site_port', 'cord_site_username', 'cord_site_password', 'cord_site_type')
-
-class XOSvNaaSOnosModelAdmin(XOSBaseAdmin):
-    verbose_name = "Open Network Operating System"
-    list_display = ('name', 'onos_ip', 'onos_port', 'onos_username', 'onos_password', 'onos_type')
-    fields = ('name', 'onos_ip', 'onos_port', 'onos_username', 'onos_password', 'onos_type')
-
-class XOSvNaaSELineAdmin(XOSBaseAdmin):
-    verbose_name = "Ethernet Virtual Private Line"
-    list_display = ('name', 'connect_point_1_id', 'connect_point_2_id', 'vlanids', 'cord_site_name', 'bwp')
-    fields = ('name', 'connect_point_1_id', 'connect_point_2_id', 'vlanids', 'cord_site_name', 'bwp')
-
-admin.site.register(XOSvNaaSBandwithProfile, XOSvNaaSBandwithProfileAdmin)
-admin.site.register(XOSvNaaSUNI, XOSvNaaSUNIAdmin)
-admin.site.register(XOSvNaaSEnterpriseLocation, XOSvNaaSEnterpriseLocationAdmin)
-admin.site.register(XOSvNaaSOnosModel, XOSvNaaSOnosModelAdmin)
-admin.site.register(XOSvNaaSELine, XOSvNaaSELineAdmin)
\ No newline at end of file
diff --git a/xos/attic/bandwidthprofile_model.py b/xos/attic/bandwidthprofile_model.py
deleted file mode 100755
index db74626..0000000
--- a/xos/attic/bandwidthprofile_model.py
+++ /dev/null
@@ -1,17 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-def __unicode__(self):  return u'%s' % (self.name)
diff --git a/xos/attic/eline_model.py b/xos/attic/eline_model.py
deleted file mode 100755
index db74626..0000000
--- a/xos/attic/eline_model.py
+++ /dev/null
@@ -1,17 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-def __unicode__(self):  return u'%s' % (self.name)
diff --git a/xos/attic/enterprisetenant_model.py b/xos/attic/enterprisetenant_model.py
deleted file mode 100755
index db74626..0000000
--- a/xos/attic/enterprisetenant_model.py
+++ /dev/null
@@ -1,17 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-def __unicode__(self):  return u'%s' % (self.name)
diff --git a/xos/attic/header.py b/xos/attic/header.py
index 449bd6b..b7100ed 100755
--- a/xos/attic/header.py
+++ b/xos/attic/header.py
@@ -19,9 +19,4 @@
 from core.models import XOSBase
 from core.models import Site
 
-VNAAS_KIND = "vnaas"
-SERVICE_NAME = 'vnaas'
-SERVICE_NAME_ELINE_VERBOSE = 'E-Line Service'
-SERVICE_NAME_ELAN_VERBOSE = 'E-LAN Service'
-SERVICE_NAME_ETREE_VERBOSE = 'E-Tree Service'
 
diff --git a/xos/attic/transportnetwork_model.py b/xos/attic/transportnetwork_model.py
deleted file mode 100755
index 941aea2..0000000
--- a/xos/attic/transportnetwork_model.py
+++ /dev/null
@@ -1,16 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-def __unicode__(self):  return u'%s' % (self.name)
diff --git a/xos/attic/usernetworkinterface_model.py b/xos/attic/usernetworkinterface_model.py
index e48251c..121611e 100755
--- a/xos/attic/usernetworkinterface_model.py
+++ b/xos/attic/usernetworkinterface_model.py
@@ -14,9 +14,7 @@
 # limitations under the License.
 
 
-def __unicode__(self):  return u'%s' % (self.name)
-
-def save(self, *args, **kwargs):
+def __xos_save_base(self, *args, **kwargs):
 
     if self.latlng:
         try:
@@ -33,4 +31,5 @@
         except:
             raise ValueError("The lat/lng value is not formatted correctly.")
 
-    super(UserNetworkInterface, self).save(*args, **kwargs)
+    return False # let xosbase know to save the model
+
diff --git a/xos/make_synchronizer_manifest.sh b/xos/make_synchronizer_manifest.sh
deleted file mode 100755
index 0b16750..0000000
--- a/xos/make_synchronizer_manifest.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-#! /bin/bash
-find synchronizer -type f | cut -b 14- > synchronizer/manifest 
diff --git a/xos/synchronizer/Makefile b/xos/synchronizer/Makefile
deleted file mode 100755
index 1c0258d..0000000
--- a/xos/synchronizer/Makefile
+++ /dev/null
@@ -1,5 +0,0 @@
-synchronizer:
-	sudo docker build --rm -f Dockerfile.synchronizer -t xosproject/vnaas-synchronizer .
-
-up:
-	docker-compose -p vnaas up -d
\ No newline at end of file
diff --git a/xos/synchronizer/docker-compose.yml b/xos/synchronizer/docker-compose.yml
deleted file mode 100755
index d24b7b6..0000000
--- a/xos/synchronizer/docker-compose.yml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-version: '2'
-
-networks:
-  xos:
-    external: true
-
-services:
-  synchronizer:
-    image: xosproject/vnaas-synchronizer
-    networks:
-      - xos
-    #command: bash -c "sleep 86400"
-    volumes:
-        - /opt/cord_profile/node_key:/opt/cord_profile/node_key:ro
-        - /opt/cord/build/platform-install/credentials/xosadmin@opencord.org:/opt/xos/services/vnaas/credentials/xosadmin@opencord.org
-    external_links:
-        - rcordbs_xos_redis_1:redis
-    logging:
-      driver: "json-file"
-      options:
-        max-size: "1000k"
-        max-file: "5"
\ No newline at end of file
diff --git a/xos/synchronizer/run_devel.sh b/xos/synchronizer/run_devel.sh
deleted file mode 100755
index bbdf1b6..0000000
--- a/xos/synchronizer/run_devel.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-
-# Copyright 2017-present Open Networking Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-
-export XOS_DIR=/opt/xos
-python vnaas-synchronizer-devel.py  -C $XOS_DIR/synchronizers/vnaas/vnaas_synchronizer_config
diff --git a/xos/synchronizer/steps/sync_vnaaseline.py b/xos/synchronizer/steps/sync_vnaaseline.py
old mode 100755
new mode 100644
index 93fd40e..53edc10
--- a/xos/synchronizer/steps/sync_vnaaseline.py
+++ b/xos/synchronizer/steps/sync_vnaaseline.py
@@ -20,10 +20,10 @@
 import json
 from synchronizers.new_base.syncstep import SyncStep
 from synchronizers.new_base.modelaccessor import *
-#from xos.logger import Logger, logging
+from xos.logger import Logger, logging
 
 from requests.auth import HTTPBasicAuth
-#logger = Logger(level=logging.INFO)
+logger = Logger(level=logging.INFO)
 
 parentdir = os.path.join(os.path.dirname(__file__), "..")
 sys.path.insert(0, parentdir)
@@ -52,8 +52,9 @@
         return HTTPBasicAuth(onos.onos_username, onos.onos_password)
 
     def sync_record(self, evc):
-        print "POST %s " % (evc)
-        #logger.info("Syncing Edited EVC: %s" % evc.name)
+        logger.info("Syncing Edited EVC: %s" % evc.name)
+        logger.info("POST %s " % (evc))
+
         # Fetch the bwp from the DB
         bwp = BandwidthProfile.objects.get(name=evc.bwp)
 
@@ -83,7 +84,7 @@
         data["ebs"] = bwp.ebs
         data["cir"] = bwp.cir
         data["eir"] = bwp.eir
-        print "data %s" % data
+        logger.info("data %s" % data)
         # assuming that the CPEs are controller by the fabric ONOS
         onos = OnosModel.objects.get(onos_type="global")
         onos_addr = self.get_onos_global_addr(onos)
@@ -91,15 +92,14 @@
         # FIXME - hardcoded auth
         auth = self.get_onos_global_auth(onos)
 
-        print "POST %s for app %s, data = %s" % (onos_addr, evc.name, data)
+        logger.info("POST %s for app %s, data = %s" % (onos_addr, evc.name, data))
 
         r = requests.post(onos_addr, data=json.dumps(data), auth=auth)
         #TODO XOS might fail to connect to ONOS.
         if (r.status_code != 200):
-            print r
+            logger.info("result = %s" % r)
             raise Exception("Received error from EVC Installation update (%d)" % r.status_code)
 
     def delete_record(self, evc):
         # TODO evaluate what to in this case.
-        print "Syncing delete EVC: %s" % evc.name
-        #logger.info("Syncing delete EVC: %s" % evc.name)
+        logger.info("Syncing delete EVC: %s" % evc.name)