Subversion Repositories SmartDukaan

Rev

Rev 4307 | Rev 4315 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 4307 Rev 4310
Line 1214... Line 1214...
1214
    try:
1214
    try:
1215
        # create a password manager
1215
        # create a password manager
1216
        password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
1216
        password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
1217
        # Add the username and password.
1217
        # Add the username and password.
1218
        configclient = ConfigClient()
1218
        configclient = ConfigClient()
1219
        ips = configclient.get_property("production_servers_public_ips");
1219
        ips = configclient.get_property("production_servers_private_ips");
1220
        ips = ips.split(" ")
1220
        ips = ips.split(" ")
1221
        
1221
        
1222
        for ip in ips:
1222
        for ip in ips:
-
 
1223
            try:
1223
            top_level_url = "http://" + ip + ":8080/"
1224
                top_level_url = "http://" + ip + ":8080/"
1224
            password_mgr.add_password(None, top_level_url, "saholic", "shop2020")
1225
                password_mgr.add_password(None, top_level_url, "saholic", "shop2020")
1225
            handler = urllib2.HTTPBasicAuthHandler(password_mgr)
1226
                handler = urllib2.HTTPBasicAuthHandler(password_mgr)
1226
            
1227
            
1227
            opener = urllib2.build_opener(handler)
1228
                opener = urllib2.build_opener(handler)
1228
    
1229
    
1229
            # use the opener to fetch a URL
1230
                # use the opener to fetch a URL
1230
            res = opener.open(top_level_url + "cache-admin/HomePageSnippets?_method=delete")
1231
                res = opener.open(top_level_url + "cache-admin/HomePageSnippets?_method=delete")
1231
            print "Successfully cleared home page cache" + res.read()
1232
                print "Successfully cleared home page cache" + res.read()
-
 
1233
            except:
-
 
1234
                print "Unable to clear home page cache" + res.read()
1232
    except:
1235
    except:
1233
        print "Unable to clear cache, still should continue with other operations"
1236
        print "Unable to clear cache, still should continue with other operations"
1234
        
1237
        
1235
def get_pending_orders_inventory(vendor_id=1):
1238
def get_pending_orders_inventory(vendor_id=1):
1236
    """
1239
    """