Skip to content

Commit

Permalink
Fix code irregular issues (#12595) (#12934)
Browse files Browse the repository at this point in the history
  • Loading branch information
mssonicbld authored Dec 5, 2022
1 parent ae80bab commit e533fa4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
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 @@ -229,15 +228,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

0 comments on commit e533fa4

Please sign in to comment.