fix(vod): define the module-level api_info that BaseService.get_api_info returns - #431
Open
Anai-Guo wants to merge 1 commit into
Open
fix(vod): define the module-level api_info that BaseService.get_api_info returns#431Anai-Guo wants to merge 1 commit into
Anai-Guo wants to merge 1 commit into
Conversation
…nfo returns
server/mcp_server_vod/src/base/base_service.py declares
@staticmethod
def get_api_info():
return api_info
but the module never defines api_info, so any call raises
NameError: name 'api_info' is not defined.
Every other base_trait.py / base_service.py in this repository (alb, cdn,
certificate_center, cloudsearch, cr, dcdn, domain_service, enterprise, ga,
iga, iot, live, mcdn, rtc, traffic_route, veen, veimagex, vke) defines the
same module-level api_info next to the identical accessor. This restores the
line the vod copy dropped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
server/mcp_server_vod/src/base/base_service.pydeclares an accessor that returns a name the module never defines:grep -n "api_info" server/mcp_server_vod/shows the onlyapi_infobinding in that server lives insrc/vod/api/config.pyand is imported bysrc/vod/api/api.py— never bybase_service.py. So callingBaseService.get_api_info()raises:Verified by extracting the method from the file as it stands on
main(5aeb8f0) and executing it:pyflakesreports it asundefined name 'api_info'.Why this is a dropped line, not a design choice
Every other base class in this repository pairs the identical accessor with a module-level
api_info:The same pairing appears in
mcp_server_alb,mcp_server_cdn,mcp_server_certificate_center,mcp_server_cloudsearch,mcp_server_cr,mcp_server_dcdn,mcp_server_domain_service,mcp_server_enterprise,mcp_server_ga,mcp_server_iga,mcp_server_iot,mcp_server_live,mcp_server_mcdn,mcp_server_rtc,mcp_server_traffic_route,mcp_server_veen,mcp_server_veimagexandmcp_server_vke— 18 copies, all with the constant.mcp_server_vodis the only one that carries the accessor without it.Fix
Restore the missing module-level binding, matching the sibling files:
Scope
1 file, +3 / −0.
get_api_info()now returns{}exactly as it does in all 18 sibling modules instead of raisingNameError. Nothing inmcp_server_vodcurrently calls it, so no existing behaviour changes — this removes a latent crash from a public accessor and brings the file back in line with the rest of the repo.🤖 Generated with Claude Code