Skip to content

Commit

Permalink
fix UnboundLocalError after failed web3 test thx @theref
Browse files Browse the repository at this point in the history
  • Loading branch information
vepkenez committed May 27, 2022
1 parent a1c9c7f commit debde39
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions nucypher_ops/ops/fleet_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def inner(self, *args, **kwargs):
provider = self.get_local_blockchain_provider()
try:
import web3
except ImportError:
self.emitter.echo("web3 must be installed to use this functionality ('pip install web3')")
except ModuleNotFoundError as e:
raise ImportError("web3 must be installed to use this functionality ('pip install web3')")
w3 = web3.Web3(web3.Web3.HTTPProvider(provider))
return method(self, w3, *args, **kwargs)
return inner
Expand Down Expand Up @@ -944,7 +944,6 @@ def defund_nodes(self, web3, hostnames, to=None, amount=None):
continue
else:
raise AttributeError(msg)
print (amount_to_send)
self.emitter.echo(f"Attempting to send {web3.fromWei(amount_to_send, 'ether')} ETH from {hostname} to {to} in 3 seconds.")
time.sleep(3)
result = self.send_eth(wallet, to, web3.fromWei(amount_to_send, 'ether'))
Expand All @@ -956,7 +955,6 @@ class DigitalOceanConfigurator(BaseCloudNodeConfigurator):
default_region = 'SFO3'
provider_name = 'digitalocean'


def get_region(self):

regions = [
Expand Down

0 comments on commit debde39

Please sign in to comment.