Projet

Général

Profil

0001-agent-adapt-for-python3-36273.patch

Frédéric Péters, 20 septembre 2019 20:10

Télécharger (2,57 ko)

Voir les différences:

Subject: [PATCH] agent: adapt for python3 (#36273)

 hobo/agent/common/management/commands/hobo_deploy.py | 6 +++---
 hobo/agent/common/management/commands/hobo_notify.py | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)
hobo/agent/common/management/commands/hobo_deploy.py
6 6
import subprocess
7 7
import sys
8 8
import tempfile
9
import urlparse
10 9

  
11 10
from django.conf import settings
12 11
from django.core.management.base import BaseCommand, CommandError
13 12
from django.core.management import call_command, get_commands
13
from django.utils.six.moves.urllib import parse as urlparse
14 14

  
15 15
from tenant_schemas.utils import tenant_context
16 16
from hobo.multitenant.middleware import TenantMiddleware, TenantNotFound
......
65 65
            if json_filename == '-':
66 66
                hobo_environment = json.load(sys.stdin)
67 67
            else:
68
                hobo_environment = json.load(file(json_filename))
68
                hobo_environment = json.load(open(json_filename))
69 69
            self.deploy(base_url, hobo_environment, ignore_timestamp)
70 70

  
71 71
    def deploy(self, base_url, hobo_environment, ignore_timestamp):
......
135 135
                continue
136 136
            tenant_idp_metadata = os.path.join(tenant.get_directory(),
137 137
                    'idp-metadata-%s.xml' % service.get('id'))
138
            replace_file(tenant_idp_metadata, response.content)
138
            replace_file(tenant_idp_metadata, response.text)
139 139
            # break now, only a single IdP is supported
140 140
            break
141 141

  
hobo/agent/common/management/commands/hobo_notify.py
43 43
            # get environment definition from stdin
44 44
            return json.load(sys.stdin)
45 45
        else:
46
            return json.load(file(notification))
46
            return json.load(open(notification))
47 47

  
48 48
    def handle(self, notification, **kwargs):
49 49
        notification = self.load_notification(notification)
50
-