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

Make Labcontroller compatible with Python 2 and Python 3 #227

Draft
wants to merge 81 commits into
base: python-3
Choose a base branch
from

Conversation

StykMartin
Copy link
Contributor

No description provided.

Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
…n function

Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Signed-off-by: Martin Styk <mart.styk@gmail.com>
Copy link

We were not able to find or create Copr project packit/beaker-project-beaker-227 specified in the config with the following error:

Packit received HTTP 500 Internal Server Error from Copr Service. Check the Copr status page: https://copr.fedorainfracloud.org/status/stats/, or ask for help in Fedora Build System matrix channel https://matrix.to/#/#buildsys:fedoraproject.org.

Unless the HTTP status code above is >= 500, please check your configuration for:

  1. typos in owner and project name (groups need to be prefixed with @)
  2. whether the project name doesn't contain not allowed characters (only letters, digits, underscores, dashes and dots must be used)
  3. whether the project itself exists (Packit creates projects only in its own namespace)
  4. whether Packit is allowed to build in your Copr project
  5. whether your Copr project/group is not private

DEPCMD := $(shell if [ -f /usr/bin/dnf ]; then echo "dnf builddep"; else echo "yum-builddep"; fi)
SUBDIRS := $(shell if [[ $(BKR_PY3) == 0 ]]; then echo "Common Client documentation Server LabController IntegrationTests"; else echo "Common Client documentation"; fi)
ifeq ($(BKR_PY3),1)
DEPCMD := dnf builddep
Copy link
Contributor

Choose a reason for hiding this comment

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

Your expectation is RHEL-7 will only run with python2 (the default) since dnf does not exist in RHEL-7.

import logging
import time
import socket
import signal
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you want to sort import files in alpha order? I think you did this last time. Up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Definitely, this should be fixed.

stop_type = ['stop', 'abort', 'cancel']
msg to record if issuing Abort or Cancel """
def task_stop(self, task_id, stop_type, msg=None):
"""tell the scheduler that we are stoping a task
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't know if you want to fix the typo s/b 'stopping'? Up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll fix it.

@StykMartin
Copy link
Contributor Author

StykMartin commented Jul 30, 2024

/packit build

predecessors.extend(
self.greenlets[c["id"]]
for c in six.itervalues(self.commands)
if "power" in c
Copy link
Contributor

Choose a reason for hiding this comment

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

I would have expected an indent here on if. However, this is the original code.


def __enter__(self):
makedirs_ignore(os.path.dirname(self.path), 0o755)
created = False
if self.create:
try:
# stdio does not have any mode string which corresponds to this
# stdio does not have any mode string which corresponds to this
Copy link
Contributor

Choose a reason for hiding this comment

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

You must be running a script to produce these changes. They're too consistent to be humanly done.

@@ -93,7 +93,7 @@ def check_all_trees(ignore_errors=False,
print('{0} is missing [Distro Tree ID {1}]'.format(
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be " instead of ' in this section? Looks like this change wasn't done in this file.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's covered in another commit.

@JohnVillalovos
Copy link
Collaborator

JohnVillalovos commented Aug 1, 2024

1st commit: 557e290 looks good to me. Merge that commit! 🙂 Then only 80 more to go after that...

2nd commit: 6783017 Also LGTM

3rd commit: 046ec78 LGTM

@JohnVillalovos
Copy link
Collaborator

Can we get this rebased against the python-3 branch?

[b"a" * 4096] * 1001 + [b"This line shouldn't be in output"] + [b""] # EOT
)

result = _read_from_pipe(mock_file)
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure I understand the purpose here. Did you want to assertEqual?

env["power_user"] = (command["power"].get("user") or "").encode("utf8")
env["power_pass"] = (command["power"].get("passwd") or "").encode("utf8")
env["power_mode"] = command["action"].encode("utf8")
power_mapping = {
Copy link
Contributor

Choose a reason for hiding this comment

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

nice rewrite!

Copy link
Contributor

@cbouchar cbouchar left a comment

Choose a reason for hiding this comment

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

I believe I covered everything and I'm fine with your changes. Lots of format changes mostly.

from glob import glob

try:
Copy link
Contributor

Choose a reason for hiding this comment

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

Martin: Further down in this file there exists a 'classifier' section which defines the following which perhaps you'd like to change?
'Programming Language :: Python :: 2.7',
I was looking at this file today and thought of you.

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.

3 participants