Skip to content

Commit

Permalink
Revert "show commands for SYSTEM READY (#1851) (#2261)"
Browse files Browse the repository at this point in the history
This reverts commit a6404b7.
  • Loading branch information
yxieca authored Jul 22, 2022
1 parent a6404b7 commit dc5c492
Show file tree
Hide file tree
Showing 8 changed files with 1 addition and 224 deletions.
120 changes: 0 additions & 120 deletions scripts/sysreadyshow

This file was deleted.

3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,7 @@
'scripts/null_route_helper',
'scripts/coredump_gen_handler.py',
'scripts/techsupport_cleanup.py',
'scripts/check_db_integrity.py',
'scripts/sysreadyshow'
'scripts/check_db_integrity.py'
],
entry_points={
'console_scripts': [
Expand Down
31 changes: 0 additions & 31 deletions show/system_health.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,34 +198,3 @@ def monitor_list():
entry.append(element[1]['type'])
table.append(entry)
click.echo(tabulate(table, header))


@system_health.group('sysready-status',invoke_without_command=True)
@click.pass_context
def sysready_status(ctx):
"""Show system-health system ready status"""

if ctx.invoked_subcommand is None:
try:
cmd = "sysreadyshow"
clicommon.run_command(cmd, display_cmd=False)
except Exception as e:
click.echo("Exception: {}".format(str(e)))


@sysready_status.command('brief')
def sysready_status_brief():
try:
cmd = "sysreadyshow --brief"
clicommon.run_command(cmd, display_cmd=False)
except Exception as e:
click.echo("Exception: {}".format(str(e)))


@sysready_status.command('detail')
def sysready_status_detail():
try:
cmd = "sysreadyshow --detail"
clicommon.run_command(cmd, display_cmd=False)
except Exception as e:
click.echo("Exception: {}".format(str(e)))
1 change: 0 additions & 1 deletion sonic_package_manager/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ def unmarshal(self, value):
ManifestField('asic-service', DefaultMarshaller(bool), False),
ManifestField('host-service', DefaultMarshaller(bool), True),
ManifestField('delayed', DefaultMarshaller(bool), False),
ManifestField('check_up_status', DefaultMarshaller(bool), False),
ManifestRoot('warm-shutdown', [
ManifestArray('after', DefaultMarshaller(str)),
ManifestArray('before', DefaultMarshaller(str)),
Expand Down
1 change: 0 additions & 1 deletion sonic_package_manager/service_creator/feature.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,5 +202,4 @@ def get_non_configurable_feature_entries(manifest) -> Dict[str, str]:
'has_per_asic_scope': str(manifest['service']['asic-service']),
'has_global_scope': str(manifest['service']['host-service']),
'has_timer': str(manifest['service']['delayed']),
'check_up_status': str(manifest['service']['check_up_status']),
}
27 changes: 0 additions & 27 deletions tests/mock_tables/state_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -823,32 +823,5 @@
"admin_status": "up",
"mtu": "9100",
"speed": "1000"
},
"ALL_SERVICE_STATUS|mgmt-framework": {
"app_ready_status": "OK",
"fail_reason": "-",
"service_status": "OK",
"update_time": "-"
},
"ALL_SERVICE_STATUS|swss": {
"app_ready_status": "OK",
"fail_reason": "-",
"service_status": "OK",
"update_time": "-"
},
"ALL_SERVICE_STATUS|bgp": {
"app_ready_status": "Down",
"fail_reason": "Inactive",
"service_status": "Down",
"update_time": "-"
},
"ALL_SERVICE_STATUS|pmon": {
"app_ready_status": "OK",
"fail_reason": "-",
"service_status": "OK",
"update_time": "-"
},
"SYSTEM_READY|SYSTEM_STATE": {
"Status":"DOWN"
}
}
5 changes: 0 additions & 5 deletions tests/sonic_package_manager/test_service_creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ def test_feature_registration(mock_sonic_db, manifest):
'has_per_asic_scope': 'False',
'has_global_scope': 'True',
'has_timer': 'False',
'check_up_status': 'False',
})


Expand All @@ -229,7 +228,6 @@ def test_feature_update(mock_sonic_db, manifest):
'has_per_asic_scope': 'False',
'has_global_scope': 'True',
'has_timer': 'False',
'check_up_status': 'False',
}
mock_connector = Mock()
mock_connector.get_entry = Mock(return_value=curr_feature_config)
Expand All @@ -252,7 +250,6 @@ def test_feature_update(mock_sonic_db, manifest):
'has_per_asic_scope': 'False',
'has_global_scope': 'True',
'has_timer': 'True',
'check_up_status': 'False',
}),
], any_order=True)

Expand All @@ -273,7 +270,6 @@ def test_feature_registration_with_timer(mock_sonic_db, manifest):
'has_per_asic_scope': 'False',
'has_global_scope': 'True',
'has_timer': 'True',
'check_up_status': 'False',
})


Expand All @@ -292,7 +288,6 @@ def test_feature_registration_with_non_default_owner(mock_sonic_db, manifest):
'has_per_asic_scope': 'False',
'has_global_scope': 'True',
'has_timer': 'False',
'check_up_status': 'False',
})


Expand Down
37 changes: 0 additions & 37 deletions tests/system_health_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,43 +306,6 @@ def test_health_detail(self):
"""
assert result.output == expected

def test_health_systemready(self):
runner = CliRunner()
result = runner.invoke(show.cli.commands["system-health"].commands["sysready-status"])
click.echo(result.output)
print("myresult:{}".format(result.output))
expected = """\
System is not ready - one or more services are not up
Service-Name Service-Status App-Ready-Status Down-Reason
-------------- ---------------- ------------------ -------------
bgp Down Down Inactive
mgmt-framework OK OK -
pmon OK OK -
swss OK OK -
"""
assert result.output == expected
result = runner.invoke(show.cli.commands["system-health"].commands["sysready-status"],["brief"])
click.echo(result.output)
print("myresult:{}".format(result.output))
expected = """\
System is not ready - one or more services are not up
"""
assert result.output == expected
result = runner.invoke(show.cli.commands["system-health"].commands["sysready-status"],["detail"])
click.echo(result.output)
print("myresult:{}".format(result.output))
expected = """\
System is not ready - one or more services are not up
Service-Name Service-Status App-Ready-Status Down-Reason AppStatus-UpdateTime
-------------- ---------------- ------------------ ------------- ----------------------
bgp Down Down Inactive -
mgmt-framework OK OK - -
pmon OK OK - -
swss OK OK - -
"""

@classmethod
def teardown_class(cls):
print("TEARDOWN")
Expand Down

0 comments on commit dc5c492

Please sign in to comment.