Skip to content

Conversation

@stephenchengCloud
Copy link
Collaborator

@stephenchengCloud stephenchengCloud commented Nov 22, 2023

  • Manually tested update-apply on XS8.
  • Passed toolstack input test 191266

cmd = ['yum', 'clean', 'all', '--noplugins', '-c', yum_conf_file]
p = subprocess.Popen(cmd, shell=False, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True, env=yum_env)
output, _ = p.communicate()
output = output.decode('utf-8')
Copy link
Member

Choose a reason for hiding this comment

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

would it be better to call Popen with encoding='utf-8' so stdout is opened in text mode?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, you're right. Corrected!

Copy link
Collaborator

Choose a reason for hiding this comment

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

universal_newlines is often used to get the string output.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Corrected and tested!

@stephenchengCloud stephenchengCloud force-pushed the private/stephenche/CP-45977 branch 3 times, most recently from bc12946 to ec6e5c1 Compare November 23, 2023 10:01
@stormi
Copy link
Contributor

stormi commented Nov 24, 2023

Minor comment: scrips should be scripts in the commit message and in the PR title.

@stephenchengCloud stephenchengCloud force-pushed the private/stephenche/CP-45977 branch from ec6e5c1 to 9f24276 Compare November 24, 2023 09:11
@stephenchengCloud stephenchengCloud changed the title CP-45977: Update scrips/extensions from python2 to python3 CP-45977: Update scripts/extensions from python2 to python3 Nov 24, 2023
@stephenchengCloud
Copy link
Collaborator Author

Minor comment: scrips should be scripts in the commit message and in the PR title.

Done!

if os.path.isfile(update_precheck_file):
pp = subprocess.Popen(update_precheck_file, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
precheck_output, _ = pp.communicate()
precheck_output = precheck_output.decode("utf-8")
Copy link
Collaborator

Choose a reason for hiding this comment

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

This one is missed for universal_newlines=True ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Corrected!

Copy link
Collaborator

@liulinC liulinC left a comment

Choose a reason for hiding this comment

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

Approved with minor comments, Please check.

Signed-off-by: Stephen Cheng <stephen.cheng@cloud.com>
@stephenchengCloud stephenchengCloud force-pushed the private/stephenche/CP-45977 branch from 9f24276 to 6693647 Compare November 27, 2023 04:49
@liulinC liulinC merged commit 5fecb76 into xapi-project:master Nov 27, 2023
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.

4 participants