Skip to content

Commit

Permalink
Fix Cleanup of IceStorm DB Files (#1544)
Browse files Browse the repository at this point in the history
The 'dbbir' variable was only initialized when 'createDb' is set to true. This resulted in
files being left behind in the IceStorm/persistence test when using two instances, as
shown in the following code snippet:

```python
icestorm1 = IceStorm(createDb=True, cleanDb=False)
icestorm2 = IceStorm(createDb=False, cleanDb=True)
```
  • Loading branch information
pepone authored Oct 11, 2023
1 parent ce1649d commit 4a163bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/IceStormUtil.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ def getExe(self, current):

def setup(self, current):
# Create the database directory
self.dbdir = os.path.join(current.testsuite.getPath(), "{0}-{1}.db".format(self.instanceName, self.replica))
if self.createDb:
self.dbdir = os.path.join(current.testsuite.getPath(), "{0}-{1}.db".format(self.instanceName, self.replica))
if os.path.exists(self.dbdir):
shutil.rmtree(self.dbdir)
os.mkdir(self.dbdir)
Expand Down

0 comments on commit 4a163bc

Please sign in to comment.