Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket #216: fix floor division operators #222

Merged
merged 1 commit into from
Jul 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Shine/Commands/Fsck.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def action_start(self, node, action, comp):

def action_progress(self, node, action, comp, result):
self._comps[comp] = result.progress
self._current = sum(self._comps.values()) / len(self._comps)
self._current = sum(self._comps.values()) // len(self._comps)
header = self.command.NAME.capitalize()
sys.stdout.write("%s in progress: %d %%\r" % (header, self._current))
sys.stdout.flush()
Expand All @@ -75,7 +75,7 @@ def action_start(self, node, action, comp):

def action_progress(self, node, action, comp, result):
self._comps[comp] = result.progress
self._current = sum(self._comps.values()) / len(self._comps)
self._current = sum(self._comps.values()) // len(self._comps)
header = self.command.NAME.capitalize()
sys.stdout.write("%s in progress: %d %%\r" % (header, self._current))
sys.stdout.flush()
Expand Down
4 changes: 2 additions & 2 deletions lib/Shine/Commands/Tune.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ def _add_quota_tuning(cls, tunings, fs_conf):
tunings.create_parameter_alias("quota_btune_oss", path)

# Convert the values to the right units
quota_btune = str(int(quota_btune) * int(quota_bunit) / 100)
quota_btune = str(int(quota_btune) * int(quota_bunit) // 100)

# Create the quota tuning parameters with the right values
tunings.create_parameter('quota_btune_mds', quota_btune, ['mds'])
Expand Down Expand Up @@ -196,7 +196,7 @@ def _add_quota_tuning(cls, tunings, fs_conf):
tunings.create_parameter_alias("quota_itune_oss", path)

# Convert the values to the right units
quota_itune = str(int(quota_itune) * int(quota_iunit) / 100)
quota_itune = str(int(quota_itune) * int(quota_iunit) // 100)

# Create the quota tuning parameters with the right values
tunings.create_parameter('quota_itune_mds', quota_itune, ['mds'])
Expand Down
2 changes: 1 addition & 1 deletion lib/Shine/Lustre/Actions/Format.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ def _prepare_cmd(self):

# loop back devices
if not self.comp.dev_isblk:
command.append('--device-size=%d' % (self.comp.dev_size / 1024))
command.append('--device-size=%d' % (self.comp.dev_size // 1024))

command.append(self.comp.dev)

Expand Down
2 changes: 1 addition & 1 deletion lib/Shine/Lustre/Actions/Fsck.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def __init__(self, passid, current, total):
@property
def progress(self):
"""Current fsck command progression value, between 1 and 100."""
return ((self.pass_id - 1 + self.pass_progress) / self._NB_PASSES) * 100
return ((self.pass_id - 1 + self.pass_progress) // self._NB_PASSES) * 100

class Fsck(FSAction):
"""
Expand Down
Loading