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 client compability #359

Merged
merged 2 commits into from
Aug 29, 2017

Conversation

typhoonzero
Copy link
Collaborator

@typhoonzero typhoonzero commented Aug 28, 2017

Fix #360
Fix client get terminating pods backward compatibility.

items := itemsRaw.([]interface{})
// NOTE: terminating section may not exist
var termJobs []interface{}
termJobsRaw, ok := respObj.(map[string]interface{})["terminating"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe shorter code:

if termJobsRaw, ok := respObj.(map[string]interface{})["terminating"]; ok {
    termJobs = termJobsRaw.([]interface{})
} else {
    termJobs = []interface{}{}
}

Copy link
Collaborator

@Yancey1989 Yancey1989 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@typhoonzero typhoonzero merged commit 95fedf5 into PaddlePaddle:develop Aug 29, 2017
@typhoonzero typhoonzero deleted the fix_client_back_compa branch November 2, 2017 10:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants