Commits

zsp042 committed ad5d220

f

Comments (0)

Files changed (1)

 
     #VpsIp.where().update(vps_one_id=0)
     from vps_sell import VpsOneIp, VpsOne
+    for i in VpsIp.where():
+        print i.data_center, i.ip, i.vps_one_id
+    #    ip = i.ip
+    #    vip = VpsIp.get(ip=i.ip)
+    #    if not i.vps_one_id:
+    #        i.delete()
+    #        continue
+    #    if vip:
+    #        vps_ip_bind(ip, i.vps_one_id)
+    #        one = VpsOne.get(i.vps_one_id)
+    #        one.data_center = vip.data_center
+    #        one.save()
+    #    else:
+    #        print i.vps_one_id, i.ip_str
+    #        if i.ip_str.startswith('119.254.'):
+    #            netmask = ip2int('255.255.255.240')
+    #            gateway = ip2int('119.254.35.97')
+    #            print netmask, gateway
+    #            one = VpsOne.get(i.vps_one_id)
+    #            vps_ip_new(one.data_center, gateway, netmask, i.ip)
 
-    for i in VpsOneIp.where():
-        ip = i.ip
-        vip = VpsIp.get(ip=i.ip)
-        if not i.vps_one_id:
-            i.delete()
-            continue
-        if vip:
-            vps_ip_bind(ip, i.vps_one_id)
-            one = VpsOne.get(i.vps_one_id)
-            one.data_center = vip.data_center
-            one.save()
-        else:
-            print i.vps_one_id, i.ip_str
-            if i.ip_str.startswith('119.254.'):
-                netmask = ip2int('255.255.255.240')
-                gateway = ip2int('119.254.35.97')
-                print netmask, gateway
-                one = VpsOne.get(i.vps_one_id)
-                vps_ip_new(one.data_center, gateway, netmask, i.ip)
-
-    vps_ip_count_reset()
+    #vps_ip_count_reset()