Code Changes includes:
 1.Sychronizer for ceilometer service.
 2.Added files:
   i.xos/synchronizer/steps/sync_ceilometerservice.py(Ceilometer sychronizer )
   ii.xos/synchronizer/steps/sync_ceilometerservice.yaml(Ansible yaml file which will be run as part of sychronizer)
   iii.xos/synchronizer/templates/update-keystone-endpoints.py.j2 (to change endpoints in keystone)
 3.Modified init script of ceilometer service image for starting pub-sub module
 4. [api] default_api_return_limit = 1000 in README and ceilometer.conf.j2 for both mitaka-v2 and mitaka-v3

Change-Id: I2ab935c2fc507a00729d14cf87bae81990b75ed9
diff --git a/xos/synchronizer/templates/update-keystone-endpoints.py.j2 b/xos/synchronizer/templates/update-keystone-endpoints.py.j2
new file mode 100755
index 0000000..212be70
--- /dev/null
+++ b/xos/synchronizer/templates/update-keystone-endpoints.py.j2
@@ -0,0 +1,46 @@
+#!/usr/bin/python
+
+"""
+Update the endpoints in a keystone db using mysql
+"""
+
+import MySQLdb
+import argparse
+import urlparse
+import sys
+
+def main(dbhost, username, password, new_endpoint, endpoint_type):
+    db = MySQLdb.connect(host=dbhost, user=username, passwd=password,
+            db="keystone")
+    cur = db.cursor()
+    cur.execute("select id, url from endpoint where interface='%s'" % endpoint_type)
+    for row in cur.fetchall():
+        url = str(row[1])
+        endpoint_id = str(row[0])
+        try:
+            u = urlparse.urlparse(url)
+            print "Changing %s to %s in URL %s" % (u.hostname,new_endpoint, url)
+            urlstring = "%s://%s:%s%s" % (u.scheme, new_endpoint, u.port,
+                u.path)
+            cur.execute("""UPDATE endpoint
+                            SET url=%s
+                            WHERE id=%s
+                            """, (urlstring, endpoint_id))
+        except Exception as e:
+            print "Could not parse URL, giving up: %s (%s)" % (url, e)
+            cur.close()
+            db.close()
+            sys.exit(1)
+    db.commit()
+    cur.close()
+    db.close()
+
+if __name__ == "__main__":
+    parser = argparse.ArgumentParser()
+    parser.add_argument("--username", help="database username", required=True)
+    parser.add_argument("--password", help="database password", required=True)
+    parser.add_argument("--host", help="database host", required=True)
+    parser.add_argument("--endpoint", help="endpoint to move the public endpoints to", required=True)
+    parser.add_argument("--endpoint-type", help="which type of endpoint to modify", required=True, choices=['public','internal','admin'])
+    args = parser.parse_args()
+    main(args.host, args.username, args.password, args.endpoint, args.endpoint_type)