Skip to content

Commit 18cfed6

Browse files
authored
Merge pull request #171 from lanl/pulido/issue96
data move bug fix
2 parents c037a6a + f3b0ddf commit 18cfed6

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

dsi/core.py

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,11 +1474,8 @@ def index(self, local_loc, remote_loc, isVerbose=False):
14741474
raise
14751475

14761476
# See if filesystem exists
1477-
try:
1478-
fs_t = t.get_table("filesystem")
1479-
if isVerbose:
1480-
print("fs table exists already, skipping for now")
1481-
except:
1477+
fs_t = t.get_table("filesystem")
1478+
if fs_t.empty:
14821479
if isVerbose:
14831480
print( "Creating new fs table")
14841481
# Create new filesystem collection with origin and remote locations
@@ -1518,7 +1515,8 @@ def copy(self, tool="copy", isVerbose=False, **kwargs):
15181515

15191516
try:
15201517
#f = os.path.join((local_loc, str(self.project_name+".db") ))
1521-
f = self.local_location+"/"+self.project_name+".db"
1518+
#f = self.local_location+"/"+self.project_name+".db"
1519+
f = self.project_name+".db"
15221520
if isVerbose:
15231521
print("db: ", f)
15241522
if os.path.exists(f):
@@ -1528,9 +1526,8 @@ def copy(self, tool="copy", isVerbose=False, **kwargs):
15281526
raise
15291527

15301528
# See if filesystem exists
1531-
try:
1532-
fs_t = t.get_table("filesystem")
1533-
except:
1529+
fs_t = t.get_table("filesystem")
1530+
if fs_t.empty:
15341531
print( " Filesystem table not found. Try running Index first.")
15351532
print( " Data copy failed. ")
15361533
return
@@ -1555,8 +1552,9 @@ def copy(self, tool="copy", isVerbose=False, **kwargs):
15551552

15561553
# Database movement
15571554
if isVerbose:
1558-
print( " cp " + os.path.join(self.local_location, str(self.project_name+".db") ) + " " + os.path.join(self.remote_location, self.project_name, self.project_name+".db" ) )
1559-
shutil.copy2(os.path.join(self.local_location, str(self.project_name+".db") ), os.path.join(self.remote_location, self.project_name, self.project_name+".db" ) )
1555+
print( " cp " + str(self.project_name+".db") + " " + os.path.join(self.remote_location, self.project_name, self.project_name+".db" ) )
1556+
#shutil.copy2(os.path.join(self.local_location, str(self.project_name+".db") ), os.path.join(self.remote_location, self.project_name, self.project_name+".db" ) )
1557+
shutil.copy2(str(self.project_name+".db"), os.path.join(self.remote_location, self.project_name, self.project_name+".db" ) )
15601558

15611559
print( " Data Copy Complete! ")
15621560
elif tool == "scp":

examples/dsi_tutorial.ipynb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@
621621
"outputs": [],
622622
"source": [
623623
"# Create Sync type with project name\n",
624-
"s = Sync(\"dsi-tutorial.db\")"
624+
"s = Sync(\"dsi-tutorial\")"
625625
]
626626
},
627627
{
@@ -634,6 +634,16 @@
634634
"s.index(local_files,remote_path,True)"
635635
]
636636
},
637+
{
638+
"cell_type": "code",
639+
"execution_count": null,
640+
"id": "62994a77-f6f4-4a39-a592-ad4cb914796e",
641+
"metadata": {},
642+
"outputs": [],
643+
"source": [
644+
"store.summary()"
645+
]
646+
},
637647
{
638648
"cell_type": "code",
639649
"execution_count": null,

0 commit comments

Comments
 (0)