Skip to content

Commit

Permalink
Fix link deletion progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
Skazza94 committed Nov 12, 2020
1 parent 5fd76b7 commit 30558f7
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 32 deletions.
2 changes: 1 addition & 1 deletion scripts/Linux/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/make -f

VERSION=3.0.2
VERSION=3.0.3
DEBIAN_PACKAGE_VERSION=1
LAUNCHPAD_NAME=user

Expand Down
5 changes: 1 addition & 4 deletions scripts/Linux/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
kathara (__VERSION__-__DEBIAN_PACKAGE_VERSION____UBUNTU_VERSION__) __UBUNTU_VERSION__; urgency=low

* Add Exception log level
* Print Operating System in `check` command
* Fix Settings bug
* Fix Bash Autocompletion
* Minor fixes

-- Mariano Scazzariello <******@gmail.com> __DATE__
2 changes: 1 addition & 1 deletion scripts/OSX/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/make -s

PRODUCT=Kathara
VERSION=3.0.2
VERSION=3.0.3
TARGET_DIRECTORY=Output
APPLE_DEVELOPER_CERTIFICATE_ID=FakeID
ROFF_DIR=../../docs/Roff
Expand Down
2 changes: 1 addition & 1 deletion scripts/Windows/installer.iss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Kathara"
#define MyAppVersion "3.0.2"
#define MyAppVersion "3.0.3"
#define MyAppPublisher "Kathara Team"
#define MyAppURL "https://www.kathara.org"
#define MyAppExeName "kathara.exe"
Expand Down
25 changes: 13 additions & 12 deletions src/Resources/manager/docker/DockerLink.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,22 +93,23 @@ def create(self, link):
def undeploy(self, lab_hash):
links = self.get_links_by_filters(lab_hash=lab_hash)

pool_size = utils.get_pool_size()
links_pool = Pool(pool_size)
if len(links) > 0:
pool_size = utils.get_pool_size()
links_pool = Pool(pool_size)

items = utils.chunk_list(links, pool_size)
items = utils.chunk_list(links, pool_size)

progress_bar = progressbar.ProgressBar(
widgets=['Deleting collision domains... ', progressbar.Bar(),
' ', progressbar.Counter(format='%(value)d/%(max_value)d')],
redirect_stdout=True,
max_value=len(links)
)
progress_bar = progressbar.ProgressBar(
widgets=['Deleting collision domains... ', progressbar.Bar(),
' ', progressbar.Counter(format='%(value)d/%(max_value)d')],
redirect_stdout=True,
max_value=len(links)
)

for chunk in items:
links_pool.map(func=partial(self._undeploy_link, True, progress_bar), iterable=chunk)
for chunk in items:
links_pool.map(func=partial(self._undeploy_link, True, progress_bar), iterable=chunk)

progress_bar.finish()
progress_bar.finish()

def wipe(self, user=None):
links = self.get_links_by_filters(user=user)
Expand Down
25 changes: 13 additions & 12 deletions src/Resources/manager/kubernetes/KubernetesLink.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,23 @@ def create(self, link, network_id):
def undeploy(self, lab_hash, networks_to_delete=None):
links = self.get_links_by_filters(lab_hash=lab_hash)

pool_size = utils.get_pool_size()
links_pool = Pool(pool_size)
if len(links) > 0:
pool_size = utils.get_pool_size()
links_pool = Pool(pool_size)

items = utils.chunk_list(links, pool_size)
items = utils.chunk_list(links, pool_size)

progress_bar = progressbar.ProgressBar(
widgets=['Deleting collision domains... ', progressbar.Bar(),
' ', progressbar.Counter(format='%(value)d/%(max_value)d')],
redirect_stdout=True,
max_value=len(links) if not networks_to_delete else len(networks_to_delete)
)
progress_bar = progressbar.ProgressBar(
widgets=['Deleting collision domains... ', progressbar.Bar(),
' ', progressbar.Counter(format='%(value)d/%(max_value)d')],
redirect_stdout=True,
max_value=len(links) if not networks_to_delete else len(networks_to_delete)
)

for chunk in items:
links_pool.map(func=partial(self._undeploy_link, networks_to_delete, True, progress_bar), iterable=chunk)
for chunk in items:
links_pool.map(func=partial(self._undeploy_link, networks_to_delete, True, progress_bar), iterable=chunk)

progress_bar.finish()
progress_bar.finish()

def wipe(self):
links = self.get_links_by_filters()
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CURRENT_VERSION = "3.0.2"
CURRENT_VERSION = "3.0.3"


def parse(version):
Expand Down

0 comments on commit 30558f7

Please sign in to comment.