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

Fix code irregular issues #12595

Merged
merged 2 commits into from
Nov 7, 2022
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
10 changes: 0 additions & 10 deletions src/sonic-ctrmgrd/ctrmgr/container_startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

def debug_msg(m):
msg = "{}: {}".format(inspect.stack()[1][3], m)
print(msg)
syslog.syslog(syslog.LOG_DEBUG, msg)


Expand Down Expand Up @@ -232,15 +231,6 @@ def container_up(feature, owner, version):
do_freeze(feature, "This version is marked disabled. Exiting ...")
return

# if not instance_higher(feature, state_data[VERSION], version):
# # TODO: May Remove label <feature_name>_<version>_enabled
# # Else kubelet will continue to re-deploy every 5 mins, until
# # master removes the lable to un-deploy.
# #
# do_freeze(feature, "bail out as current deploy version {} is not higher".
# format(version))
# return

update_data(state_db, feature, { VERSION: version })

mode = state_data[REMOTE_STATE]
Expand Down
8 changes: 5 additions & 3 deletions src/sonic-ctrmgrd/ctrmgr/ctrmgrd.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@

def log_debug(m):
msg = "{}: {}".format(inspect.stack()[1][3], m)
#print(msg)
syslog.syslog(syslog.LOG_DEBUG, msg)


Expand Down Expand Up @@ -176,7 +175,7 @@ def register_db(self, db_name):
self.db_connectors[db_name] = swsscommon.DBConnector(db_name, 0)


def register_timer(self, ts, handler, args=()):
def register_timer(self, ts, handler, args=None):
""" Register timer based handler.
The handler will be called on/after give timestamp, ts
"""
Expand Down Expand Up @@ -239,7 +238,10 @@ def run(self):
lst = self.timer_handlers[k]
del self.timer_handlers[k]
for fn in lst:
fn[0](*fn[1])
if fn[1] is None:
fn[0]()
else:
fn[0](*fn[1])
else:
timeout = (k - ct_ts).seconds
break
Expand Down
2 changes: 0 additions & 2 deletions src/sonic-ctrmgrd/ctrmgr/kube_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,6 @@ def _do_join(server, port, insecure):
out = ""
ret = 0
try:
#local_ipv6 = _get_local_ipv6()
#_download_file(server, port, insecure)
_gen_cli_kubeconf(server, port, insecure)
_do_reset(True)
_run_command("modprobe br_netfilter")
Expand Down