Commit 9f94632c authored by Renán Sosa Guillen's avatar Renán Sosa Guillen

L2A propudct population

parent abb0da9f
...@@ -34,6 +34,7 @@ class Command(BaseCommand): ...@@ -34,6 +34,7 @@ class Command(BaseCommand):
sftp = ssh.open_sftp() ## Creates SFTPClient() object sftp = ssh.open_sftp() ## Creates SFTPClient() object
sftp.chdir(path) sftp.chdir(path)
file_list = sftp.listdir() file_list = sftp.listdir()
file_list.sort()
for file in file_list: for file in file_list:
file_name = file.replace(".zip", '') file_name = file.replace(".zip", '')
...@@ -57,7 +58,7 @@ class Command(BaseCommand): ...@@ -57,7 +58,7 @@ class Command(BaseCommand):
# print "Product " + file_name + " is ALREADY in DB." # print "Product " + file_name + " is ALREADY in DB."
except: except:
print "Error con archivo " + file_name print "Error con archivo " + file
except Exception as e: except Exception as e:
sys.stderr.write("SSH connection error: {0}".format(e)) sys.stderr.write("SSH connection error: {0}".format(e))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment