Skip to content

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

@Yancey0623 Yancey0623 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.

2 participants