-
Notifications
You must be signed in to change notification settings - Fork 191
Update bootstrap script with new paths #343
Update bootstrap script with new paths #343
Conversation
neo/Prompt/Commands/Bootstrap.py
Outdated
@@ -7,6 +7,9 @@ | |||
import shutil | |||
import os | |||
|
|||
DEFAULT_TMP_BOOTSTRAP_FILE = os.path.join(settings.DATA_DIR_PATH, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this const into the function, because the settings data for might be changed using the --datadir argument, which would not be used like this
neo/Prompt/Commands/Bootstrap.py
Outdated
|
||
print("bootstrap cancelled") | ||
sys.exit(0) | ||
|
||
|
||
def do_bootstrap(bootstrap_file, destination_dir, tmp_file_name='./Chains/bootstrap.tar.gz', tmp_chain_name='tmpchain'): | ||
def do_bootstrap(bootstrap_file, destination_dir, tmp_file_name=DEFAULT_TMP_BOOTSTRAP_FILE, tmp_chain_name='tmpchain'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could use None
instead and then use the data dir
@@ -92,6 +99,7 @@ def do_bootstrap(bootstrap_file, destination_dir, tmp_file_name='./Chains/bootst | |||
print("cleaning up %s " % tmp_chain_name) | |||
if os.path.exists(tmp_chain_name): | |||
shutil.rmtree(tmp_chain_name) | |||
os.remove(tmp_file_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to keep the downloaded file, for test bootstrap perhaps? Cc @localhuman
Thanks for contributing! 👍 Edit: please run |
4d37b8d
to
d16d893
Compare
What current issue(s) does this address, or what feature is it adding?
#338 - With the new user data paths, the download of the bootstrap files are failing.
How did you solve this problem?
Removed the hard-coded relative paths in the bootstrap script and added dynamic user paths based on the new
DATA_DIR_PATH
.How did you make sure your solution works?
Checked it manually. Downloaded the chains on my personal computer using these changes.
Are there any special changes in the code that we should be aware of?
Not really, I just added a call to
os.remove()
on the downloaded file since it isn't removed and stays there wasting space.Please check the following, if applicable:
make lint
?make test
?CHANGELOG.rst
? (if not, please do)