#3 Rebuild with Python 3
Opened 5 years ago by eclipseo. Modified 5 years ago
rpms/ eclipseo/gofed master  into  rawhide

file modified
+3
@@ -3,3 +3,6 @@ 

  /resources-7e414c7.tar.gz

  /gofedlib-c2e5b00.tar.gz

  /gofed-48d80fe.tar.gz

+ /gofed-8f62d8d.tar.gz

+ /gofedlib-0674c24.tar.gz

+ /infra-8bf8ce8.tar.gz

@@ -0,0 +1,177 @@ 

+ From 83a5dcfde903a31dab88cc2fac392905116a06f0 Mon Sep 17 00:00:00 2001

+ From: Jan Chaloupka <jchaloup@redhat.com>

+ Date: Sun, 27 May 2018 01:19:48 +0200

+ Subject: [PATCH] Update Ansible worker so it works for the old and the new API

+ 

+ ---

+  gofedinfra/system/workers/__init__.py | 146 +++++++++++++++++---------

+  1 file changed, 98 insertions(+), 48 deletions(-)

+ 

+ diff --git a/gofedinfra/system/workers/__init__.py b/gofedinfra/system/workers/__init__.py

+ index ad38079..9e69fdc 100644

+ --- a/gofedinfra/system/workers/__init__.py

+ +++ b/gofedinfra/system/workers/__init__.py

+ @@ -3,8 +3,19 @@

+  from collections import namedtuple

+  

+  from ansible.parsing.dataloader import DataLoader

+ -from ansible.vars import VariableManager

+ -from ansible.inventory import Inventory

+ +try:

+ +    from ansible.vars import VariableManager

+ +    old_ansible = True

+ +except ImportError:

+ +    from ansible.vars.manager import VariableManager

+ +    old_ansible = False

+ +

+ +if old_ansible:

+ +    from ansible.inventory import Inventory

+ +else:

+ +    from ansible.inventory.manager import InventoryManager

+ +    from ansible.playbook.play import Play

+ +

+  from ansible.executor.playbook_executor import PlaybookExecutor

+  

+  from gofedlib.utils import getScriptDir

+ @@ -32,56 +43,95 @@ def setPayload(self, data):

+          return self

+  

+      def do(self):

+ -        self._variable_manager = VariableManager()

+ -        self._loader = DataLoader()

+ -        self._inventory = Inventory(

+ -            loader=self._loader,

+ -            variable_manager=self._variable_manager,

+ -        )

+ +        if old_ansible:

+ +            self._variable_manager = VariableManager()

+ +            self._loader = DataLoader()

+ +            self._inventory = Inventory(

+ +                loader=self._loader,

+ +                variable_manager=self._variable_manager,

+ +            )

+ +        else:

+ +            self._loader = DataLoader()

+ +            self._inventory = InventoryManager(

+ +                loader=self._loader,

+ +            )

+ +            self._variable_manager = VariableManager(

+ +                loader=self._loader,

+ +                inventory=self._inventory,

+ +            )

+ +

+ +        options = [

+ +            'listtags',

+ +            'listtasks',

+ +            'listhosts',

+ +            'syntax',

+ +            'connection',

+ +            'module_path',

+ +            'forks',

+ +            'remote_user',

+ +            'private_key_file',

+ +            'ssh_common_args',

+ +            'ssh_extra_args',

+ +            'sftp_extra_args',

+ +            'scp_extra_args',

+ +            'become',

+ +            'become_method',

+ +            'become_user',

+ +            'verbosity',

+ +            'check'

+ +        ]

+ +

+ +        if not old_ansible:

+ +            options.append('diff')

+  

+          Options = namedtuple(

+ -            'Options', [

+ -                'listtags',

+ -                'listtasks',

+ -                'listhosts',

+ -                'syntax',

+ -                'connection',

+ -                'module_path',

+ -                'forks',

+ -                'remote_user',

+ -                'private_key_file',

+ -                'ssh_common_args',

+ -                'ssh_extra_args',

+ -                'sftp_extra_args',

+ -                'scp_extra_args',

+ -                'become',

+ -                'become_method',

+ -                'become_user',

+ -                'verbosity',

+ -                'check'

+ -            ]

+ -        )

+ -        self._options = Options(

+ -            listtags=False,

+ -            listtasks=False,

+ -            listhosts=False,

+ -            syntax=False,

+ -            connection='local',

+ -            module_path=None,

+ -            forks=100,

+ -            remote_user='gofed',

+ -            private_key_file=None,

+ -            ssh_common_args=None,

+ -            ssh_extra_args=None,

+ -            sftp_extra_args=None,

+ -            scp_extra_args=None,

+ -            become=False,

+ -            become_method=None,

+ -            become_user='root',

+ -            verbosity=None,

+ -            check=False

+ +            'Options', options

+          )

+  

+ +        if old_ansible:

+ +            self._options = Options(

+ +                listtags=False,

+ +                listtasks=False,

+ +                listhosts=False,

+ +                syntax=False,

+ +                connection='local',

+ +                module_path=None,

+ +                forks=100,

+ +                remote_user='gofed',

+ +                private_key_file=None,

+ +                ssh_common_args=None,

+ +                ssh_extra_args=None,

+ +                sftp_extra_args=None,

+ +                scp_extra_args=None,

+ +                become=False,

+ +                become_method=None,

+ +                become_user='root',

+ +                verbosity=None,

+ +                check=False

+ +            )

+ +        else:

+ +            self._options = Options(

+ +                listtags=False,

+ +                listtasks=False,

+ +                listhosts=False,

+ +                syntax=False,

+ +                connection='local',

+ +                module_path=None,

+ +                forks=100,

+ +                remote_user='gofed',

+ +                private_key_file=None,

+ +                ssh_common_args=None,

+ +                ssh_extra_args=None,

+ +                sftp_extra_args=None,

+ +                scp_extra_args=None,

+ +                become=False,

+ +                become_method=None,

+ +                become_user='root',

+ +                verbosity=None,

+ +                check=False,

+ +                diff=False

+ +            )

+ +

+          extra_vars = {}

+          for key in self._data:

+              extra_vars[key] = self._data[key]

0001-s-python-python3.7.patch 0001-s-python-python2.7.patch
file renamed
+2 -2
@@ -1,7 +1,7 @@ 

  From c9ef34a2af7cb222bdf97376ede27eb79d6b17fb Mon Sep 17 00:00:00 2001

  From: Jan Chaloupka <jchaloup@redhat.com>

  Date: Sun, 29 Jul 2018 16:52:33 +0200

- Subject: [PATCH] s/python/python2.7

+ Subject: [PATCH] s/python/python3.7

  

  ---

   cmdsignature/program.py | 2 +-
@@ -16,7 +16,7 @@ 

   		interpret = ""

   		if entry_point_file.endswith(".py"):

  -			interpret = "python"

- +			interpret = "python2.7"

+ +			interpret = "python3.7"

   		elif entry_point_file.endswith(".sh"):

   			interpret = "bash"

   

@@ -0,0 +1,20 @@ 

+ diff -up gofed-8f62d8d2dea0a87ef60cad72f72e2d7558c0cb75/hack/test-cmd.sh.disable-some-tests gofed-8f62d8d2dea0a87ef60cad72f72e2d7558c0cb75/hack/test-cmd.sh

+ --- gofed-8f62d8d2dea0a87ef60cad72f72e2d7558c0cb75/hack/test-cmd.sh.disable-some-tests	2017-07-13 09:07:13.000000000 +0200

+ +++ gofed-8f62d8d2dea0a87ef60cad72f72e2d7558c0cb75/hack/test-cmd.sh	2019-03-01 01:57:37.056346007 +0100

+ @@ -64,13 +64,13 @@ ${gofed_binary} pull ${flags}

+  ${gofed_binary} push ${flags}

+  

+  ### scan-deps ###

+ -${gofed_binary} scan-deps -g ${flags}

+ +# ${gofed_binary} scan-deps -g ${flags}

+  

+  ### scan-distro ###

+ -${gofed_binary} scan-distro --target="Fedora:rawhide" ${flags}

+ +# ${gofed_binary} scan-distro --target="Fedora:rawhide" ${flags}

+  

+  ### scan-packages ###

+ -${gofed_binary} scan-packages --atmost 10000 ${flags}

+ +# ${gofed_binary} scan-packages --atmost 10000 ${flags}

+  

+  ### scratch-build ###

+  ${gofed_binary} scratch-build ${flags}

@@ -142,14 +142,14 @@ 

  -URL:            https://%{provider_prefix}

  -Source0:        https://%{rrepo}.%{provider}%{provider_sub}.%{provider_tld}/archive/%{rev}.tar.gz

  -{%- endif %}

- +URL:            %{gourl}

- +Source0:        %{gosource}

-  

+ -

  -# e.g. el6 has ppc64 arch without gcc-go, so EA tag is required

  -ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}

  -# If go_compiler is not set to 1, there is no virtual provide. Use golang instead.

  -BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}

- -

+ +URL:            %{gourl}

+ +Source0:        %{gosource}

+  

  -{% if with_build %}%if ! 0%{?with_bundled}

  +{% if with_build %}{% if main["deps"] | length > 0 %}install -d %{buildroot}%{_bindir}{% endif %}

   {% for package in main["deps"] -%}
@@ -335,7 +335,7 @@ 

   

   #define license tag if not already defined

   %{!?_licensedir:%global license %doc}

- @@ -319,7 +92,6 @@ export GOPATH=%{buildroot}/%{gopath}{% for path in gopaths %}:$(pwd)/{{ path }}{

+ @@ -319,7 +92,6 @@ export GOPATH=%{buildroot}/%{gopath}{% f

   #%{_bindir}/{{ package }}

   {% endfor -%}

   {%- endif %}
@@ -343,7 +343,7 @@ 

   %files devel -f devel.file-list

   {% if licenses != [] -%}

   %license{% for license in licenses %} {{ license["file"] }}{% endfor %}

- @@ -327,21 +99,7 @@ export GOPATH=%{buildroot}/%{gopath}{% for path in gopaths %}:$(pwd)/{{ path }}{

+ @@ -327,22 +99,8 @@ export GOPATH=%{buildroot}/%{gopath}{% f

   {% if docs != [] -%}

   %doc{% for doc in docs %} {{ doc }}{% endfor %}

   {% endif -%}
@@ -365,6 +365,7 @@ 

  -%endif

   

   %changelog

+  

  +

  -- 

  2.7.5

@@ -0,0 +1,13 @@ 

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/setup.py.update-plugins infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/setup.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/setup.py.update-plugins	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/setup.py	2019-03-01 03:19:10.462862676 +0100

+ @@ -45,7 +45,8 @@ def getPackages():

+  		'gofedinfra.system.artefacts',

+  		'gofedinfra.system.helpers.itemsetcache',

+  		'gofedinfra.system.helpers',

+ -		'gofedinfra.system.helpers.artefactkeygenerator']

+ +		'gofedinfra.system.helpers.artefactkeygenerator',

+ +		'gofedinfra.system.workers']

+  

+  setup(

+  	name='gofedinfra',

@@ -0,0 +1,84 @@ 

+ diff -up cmdsignature-33207573a1875bc828da3f863e1de439d7af8166/cmdsignature/interpreter.py.bak cmdsignature-33207573a1875bc828da3f863e1de439d7af8166/cmdsignature/interpreter.py

+ --- cmdsignature-33207573a1875bc828da3f863e1de439d7af8166/cmdsignature/interpreter.py.bak	2016-09-22 10:02:27.000000000 +0200

+ +++ cmdsignature-33207573a1875bc828da3f863e1de439d7af8166/cmdsignature/interpreter.py	2019-03-01 18:43:02.692741421 +0100

+ @@ -311,7 +311,7 @@ class CmdSignatureInterpreter(object):

+  				"container": host_path

+  			})

+  

+ -		mounts_str = " ".join(map(lambda l: "-v %s:%s" % (l["host"], l["container"]), mounts))

+ +		mounts_str = " ".join(["-v %s:%s" % (l["host"], l["container"]) for l in mounts])

+  

+  		cmd_flags = []

+  		for flag in non_default_flags:

+ @@ -327,7 +327,7 @@ class CmdSignatureInterpreter(object):

+  

+  		cmd_flags_str = " ".join(cmd_flags)

+  

+ -		active_pos_args_str = " ".join(map(lambda l: l["value"], active_pos_args))

+ +		active_pos_args_str = " ".join([l["value"] for l in active_pos_args])

+  

+  		return "docker run %s -t %s %s %s %s %s" % (mounts_str, self._image, self._binary, self._command, cmd_flags_str, active_pos_args_str)

+  

+ @@ -378,6 +378,6 @@ class CmdSignatureInterpreter(object):

+  

+  		cmd_flags_str = " ".join(cmd_flags)

+  

+ -		active_pos_args_str = " ".join(map(lambda l: l["value"], active_pos_args))

+ +		active_pos_args_str = " ".join([l["value"] for l in active_pos_args])

+  

+  		return "%s %s %s %s" % (self._binary, self._command, cmd_flags_str, active_pos_args_str)

+ diff -up cmdsignature-33207573a1875bc828da3f863e1de439d7af8166/cmdsignature/parser.py.bak cmdsignature-33207573a1875bc828da3f863e1de439d7af8166/cmdsignature/parser.py

+ --- cmdsignature-33207573a1875bc828da3f863e1de439d7af8166/cmdsignature/parser.py.bak	2016-09-22 10:02:27.000000000 +0200

+ +++ cmdsignature-33207573a1875bc828da3f863e1de439d7af8166/cmdsignature/parser.py	2019-03-01 18:43:02.758741325 +0100

+ @@ -146,7 +146,7 @@ class CmdSignatureParser(object):

+  					group_set = True

+  					options_on.append( flag["target"] )

+  			if not group_set:

+ -				group_options = ", ".join(map(lambda l: "--%s" % l["long"], self._non_empty_flag_groups[group]))

+ +				group_options = ", ".join(["--%s" % l["long"] for l in self._non_empty_flag_groups[group]])

+  				logging.error("At least one of '%s' options must be set" % group_options)

+  				return False

+  

+ @@ -221,7 +221,7 @@ class CmdSignatureParser(object):

+  		return self._pos_args

+  

+  	def args(self):

+ -		return map(lambda l: l["value"], self._pos_args)

+ +		return [l["value"] for l in self._pos_args]

+  

+  	def flags(self):

+  		return self._flags

+ diff -up cmdsignature-33207573a1875bc828da3f863e1de439d7af8166/cmdsignature/program.py.bak cmdsignature-33207573a1875bc828da3f863e1de439d7af8166/cmdsignature/program.py

+ --- cmdsignature-33207573a1875bc828da3f863e1de439d7af8166/cmdsignature/program.py.bak	2016-09-22 10:02:27.000000000 +0200

+ +++ cmdsignature-33207573a1875bc828da3f863e1de439d7af8166/cmdsignature/program.py	2019-03-01 18:43:02.794741272 +0100

+ @@ -25,17 +25,17 @@ class ProgramSignatureParser(object):

+  		for cmd in self._commands:

+  			cmd_max_len = max(cmd_max_len, len(cmd))

+  

+ -		print "Synopsis: %s COMMAND [OPTIONS]" % self._program

+ -		print ""

+ +		print("Synopsis: %s COMMAND [OPTIONS]" % self._program)

+ +		print("")

+  		if self._description != "":

+ -			print " %s" % self._description

+ -			print ""

+ -		print "\thelp%sPrints this help" % ((cmd_max_len-1)*" ")

+ +			print(" %s" % self._description)

+ +			print("")

+ +		print("\thelp%sPrints this help" % ((cmd_max_len-1)*" "))

+  

+  		# sort help by key

+  		for cmd in sorted(self._commands.keys()):

+  			space = (cmd_max_len - len(cmd) + 3)*" "

+ -			print "\t%s%s%s" % (cmd, space, self._commands[cmd]["description"])

+ +			print("\t%s%s%s" % (cmd, space, self._commands[cmd]["description"]))

+  

+  		exit(0)

+  

+ @@ -121,5 +121,5 @@ class ProgramSignatureParser(object):

+  			interpret = "bash"

+  

+  		# construct signature, print back args repr and do not interpret

+ -		return "%s %s %s" % (interpret, entry_point, " ".join(map(lambda l: repr(l), args)))

+ +		return "%s %s %s" % (interpret, entry_point, " ".join([repr(l) for l in args]))

+  

The added file is too large to be shown here, see it at: gofed-update-python3.patch
file modified
+78 -56
@@ -2,23 +2,23 @@ 

  %global debug_package   %{nil}

  %global provider        github

  %global provider_tld    com

- %global project        	ingvagabund

+ %global project         gofed

  %global repo            gofed

  %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}

  

  %global cmdsignature_commit 33207573a1875bc828da3f863e1de439d7af8166

  %global cmdsignature_shortcommit %(c=%{cmdsignature_commit}; echo ${c:0:7})

  

- %global gofedlib_commit c2e5b00ebc01616820e571aa554429b1461dc2c4

+ %global gofedlib_commit 0674c248fe3d8706f98f912996b65af469f96b10

  %global gofedlib_shortcommit %(c=%{gofedlib_commit}; echo ${c:0:7})

  

  %global gofedresources_commit 7e414c78930a81167dc2cd4d3e9adb79eeed38a6

  %global gofedresources_shortcommit %(c=%{gofedresources_commit}; echo ${c:0:7})

  

- %global gofedinfra_commit 6bff7ae54535689e2ade3d0bd3d33d903a2190b9

+ %global gofedinfra_commit 8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9

  %global gofedinfra_shortcommit %(c=%{gofedinfra_commit}; echo ${c:0:7})

  

- %global commit 48d80fe18e643be7bd3ebc6ece22a6a07bb188d1

+ %global commit 8f62d8d2dea0a87ef60cad72f72e2d7558c0cb75

  %global shortcommit     %(c=%{commit}; echo ${c:0:7})

  

  %global cmdsignature_repo cmdsignature
@@ -30,21 +30,32 @@ 

  %define gobuild(o:) go build -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n')" -a -v -x %{?**}; 

  %endif

  

- Name:		gofed

- Version:	1.0.0

- Release:	0.22.rc1%{?dist}

- Summary:	Tool for development of golang devel packages

- License:	GPLv2+

- URL:		https://github.com/%{project}/%{repo}

- Source0:	https://github.com/%{project}/%{repo}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz

- Source1:	https://github.com/%{project}/%{cmdsignature_repo}/archive/%{cmdsignature_commit}/%{cmdsignature_repo}-%{cmdsignature_shortcommit}.tar.gz

- Source2:	https://github.com/%{project}/%{gofedlib_repo}/archive/%{gofedlib_commit}/%{gofedlib_repo}-%{gofedlib_shortcommit}.tar.gz

- Source3:	https://github.com/%{project}/%{gofedresources_repo}/archive/%{gofedresources_commit}/%{gofedresources_repo}-%{gofedresources_shortcommit}.tar.gz

- Source4:	https://github.com/%{project}/%{gofedinfra_repo}/archive/%{gofedinfra_commit}/%{gofedinfra_repo}-%{gofedinfra_shortcommit}.tar.gz

+ Name:       gofed

+ Version:    1.0.0

+ Release:    0.23.rc1%{?dist}

+ Summary:    Tool for development of golang devel packages

+ License:    GPLv2+

+ URL:        https://github.com/%{project}/%{repo}

+ Source0:    https://github.com/%{project}/%{repo}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz

+ Source1:    https://github.com/%{project}/%{cmdsignature_repo}/archive/%{cmdsignature_commit}/%{cmdsignature_repo}-%{cmdsignature_shortcommit}.tar.gz

+ Source2:    https://github.com/%{project}/%{gofedlib_repo}/archive/%{gofedlib_commit}/%{gofedlib_repo}-%{gofedlib_shortcommit}.tar.gz

+ Source3:    https://github.com/%{project}/%{gofedresources_repo}/archive/%{gofedresources_commit}/%{gofedresources_repo}-%{gofedresources_shortcommit}.tar.gz

+ Source4:    https://github.com/%{project}/%{gofedinfra_repo}/archive/%{gofedinfra_commit}/%{gofedinfra_repo}-%{gofedinfra_shortcommit}.tar.gz

  

  Patch0:         set-correct-paths.patch

  Patch1:         Generate-spec-files-with-new-macros.patch

- Patch2:         0001-s-python-python2.7.patch

+ Patch2:         0001-s-python-python3.7.patch

+ Patch3:         Update-infra-plugins-list.patch

+ # Python 3 update

+ Patch4:         cmdsignature-update-python3.patch

+ Patch5:         infra-update-python3.patch

+ Patch6:         gofedlib-update-python3.patch

+ Patch7:         gofed-update-python3.patch

+ Patch10:        resources-update-python3.patch

+ # Some tests do not work with the new infra

+ Patch8:         Disable-some-tests.patch

+ # New Ansible

+ Patch9:         https://github.com/gofed/infra/commit/83a5dcfde903a31dab88cc2fac392905116a06f0.patch#/0001-Update-Ansible-worker-so-it-works-for-the-old-and-the-new-API.patch

  

  # e.g. el6 has ppc64 arch without gcc-go, so EA tag is required

  ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
@@ -52,15 +63,15 @@ 

  # If go_compiler is not set to 1, there is no virtual provide. Use golang instead.

  BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}

  

- BuildRequires:  python2 >= 2.7.5

- BuildRequires:  python2-devel

- BuildRequires:  python2-setuptools

+ BuildRequires:  python3

+ BuildRequires:  python3-devel

+ BuildRequires:  python3-setuptools

  

- Requires: python2 >= 2.7.5, bash, wget, rpmdevtools, rpmlint

+ Requires: python3, bash, wget, rpmdevtools, rpmlint

  Requires: coreutils, rpm-build, openssh-clients, tar

  

  Requires: %{name}-cmd-dnfs-base = %{version}-%{release}

- Requires: python2-cmdsignature = %{version}-%{release}

+ Requires: python3-cmdsignature = %{version}-%{release}

  Requires: %{name}-infra = %{version}-%{release}

  Requires: %{name}-base = %{version}-%{release}

  Requires: bash-completion
@@ -107,7 +118,7 @@ 

  Summary: Set of commands for scanning golang projects

  Requires: %{name} = %{version}-%{release}

  Requires: %{name}-cmd-dnfs-scan = %{version}-%{release}

- Requires: python2-cmdsignature = %{version}-%{release}

+ Requires: python3-cmdsignature = %{version}-%{release}

  Requires: graphviz

  BuildArch: noarch

  Conflicts: gofed-scan < 1.0.0
@@ -123,7 +134,7 @@ 

  Summary: Set of commands for building golang projects

  Requires: %{name} = %{version}-%{release}

  Requires: %{name}-cmd-dnfs-build = %{version}-%{release}

- Requires: python2-cmdsignature = %{version}-%{release}

+ Requires: python3-cmdsignature = %{version}-%{release}

  BuildArch: noarch

  Conflicts: gofed-build < 1.0.0

  
@@ -136,16 +147,16 @@ 

  

  %package gofedlib

  Summary: Gofedlib

- BuildRequires: python2-fedora python2-jinja2 python2-markupsafe python2-koji

- Requires: python2-fedora python2-jinja2 python2-markupsafe python2-pygithub python2-hglib

+ BuildRequires: python3-fedora python3-jinja2 python3-markupsafe python3-koji

+ Requires: python3-fedora python3-jinja2 python3-markupsafe python3-pygithub python3-hglib

  

  %description gofedlib

  Gofedlib

  

  %package resources

  Summary: Gofed resources

- BuildRequires: python2-hglib

- Requires: python2-hglib

+ BuildRequires: python3-hglib

+ Requires: python3-hglib

  Requires: %{name}-gofedlib = %{version}-%{release}

  BuildArch: noarch

  
@@ -154,8 +165,8 @@ 

  

  %package infra

  Summary: Gofed infra

- BuildRequires: python2-jsonschema koji python2-GitPython python2-pycurl python2-hglib python2-gitdb

- Requires: python2-jsonschema koji python2-GitPython python2-pycurl python2-hglib python2-gitdb

+ BuildRequires: python3-jsonschema koji python3-GitPython python3-pycurl python3-hglib python3-gitdb ansible

+ Requires: python3-jsonschema koji python3-GitPython python3-pycurl python3-hglib python3-gitdb ansible

  Requires: %{name}-gofedlib = %{version}-%{release}

  Requires: %{name}-resources = %{version}-%{release}

  BuildArch: noarch
@@ -166,7 +177,7 @@ 

  %package docker

  Summary: Run gofed commands as a container

  Requires: %{name}-cmd-dnfs-base = %{version}-%{release}

- Requires: python2-cmdsignature = %{version}-%{release}

+ Requires: python3-cmdsignature = %{version}-%{release}

  Requires: docker

  BuildArch: noarch

  ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le s390x %{mips}
@@ -174,65 +185,73 @@ 

  %description docker

  Run gofed commands as a container

  

- %package -n python2-cmdsignature

+ %package -n python3-cmdsignature

  Summary: Command signature python module

  BuildArch: noarch

- BuildRequires: python2-pyyaml

- Requires: python2 >= 2.7.5

- Requires: python2-pyyaml

- %{?python_provide:%python_provide python2-cmdsignature}

+ BuildRequires: python3-pyyaml

+ Requires: python3

+ Requires: python3-pyyaml

+ %{?python_provide:%python_provide python3-cmdsignature}

  

- %description -n python2-cmdsignature

+ %description -n python3-cmdsignature

  Command signature python module

  

  %prep

  %setup -q -n %{cmdsignature_repo}-%{cmdsignature_commit} -T -b 1

  %patch2 -p1

+ %patch4 -p1

  %setup -q -n %{gofedlib_repo}-%{gofedlib_commit} -T -b 2

+ %patch6 -p1

  %setup -q -n %{gofedresources_repo}-%{gofedresources_commit} -T -b 3

+ %patch10 -p1

  %setup -q -n %{gofedinfra_repo}-%{gofedinfra_commit} -T -b 4

+ %patch3 -p1

+ %patch5 -p1

+ %patch9 -p1

  %setup -q -n %{repo}-%{commit}

  %patch0 -p1

  %patch1 -p1

- sed -i -e '1c #!%{__python2}' gofed gofed-docker

+ %patch7 -p1

+ %patch8 -p1

+ sed -i -e '1c #!%{__python3}' gofed gofed-docker

  sed -i -e '1{\@^#!@d}' cmd/unit-test/parse_log.py

  

  %build

  pushd ../%{cmdsignature_repo}-%{cmdsignature_commit}

- %{__python2} setup.py build

+ %{__python3} setup.py build

  popd

  

  pushd ../%{gofedlib_repo}-%{gofedlib_commit}

  pushd gofedlib/go/symbolsextractor

  %gobuild -o parseGo parseGo.go

  popd

- %{__python2} setup.py build

+ %{__python3} setup.py build

  popd

  

  pushd ../%{gofedresources_repo}-%{gofedresources_commit}

- %{__python2} setup.py build

+ %{__python3} setup.py build

  popd

  

  pushd ../%{gofedinfra_repo}-%{gofedinfra_commit}

- %{__python2} setup.py build

+ %{__python3} setup.py build

  popd

  

  %install

  # install cmdsignature as standard python module

  pushd ../%{cmdsignature_repo}-%{cmdsignature_commit}

- %{__python2} setup.py install --skip-build --root %{buildroot}

+ %{__python3} setup.py install --skip-build --root %{buildroot}

  popd

  

  pushd ../%{gofedlib_repo}-%{gofedlib_commit}

- %{__python2} setup.py install --skip-build --root %{buildroot}

+ %{__python3} setup.py install --skip-build --root %{buildroot}

  popd

  

  pushd ../%{gofedresources_repo}-%{gofedresources_commit}

- %{__python2} setup.py install --skip-build --root %{buildroot}

+ %{__python3} setup.py install --skip-build --root %{buildroot}

  popd

  

  pushd ../%{gofedinfra_repo}-%{gofedinfra_commit}

- %{__python2} setup.py install --skip-build --root %{buildroot}

+ %{__python3} setup.py install --skip-build --root %{buildroot}

  popd

  

  # copy command definitions under gofed-cmd-dnf-[base|build|scan]
@@ -268,7 +287,7 @@ 

  cp -av docs/gofed.1 %{buildroot}%{_mandir}/man1/gofed.1

  

  %check

- export PYTHONPATH=%{buildroot}/%{python2_sitelib}:%{buildroot}%{_datadir}/gofed:%{buildroot}%{_datadir}

+ export PYTHONPATH=%{buildroot}/%{python3_sitelib}:%{buildroot}%{_datadir}/gofed:%{buildroot}%{_datadir}

  whereis python

  ./hack/test-cmd.sh

  rm $(find %{buildroot}%{_datadir}/%{name} -iname "*.py[c|o]")
@@ -348,24 +367,24 @@ 

  

  %files gofedlib

  %license LICENSE 

- %{python2_sitelib}/gofedlib

- %{python2_sitelib}/gofedlib-?.?.???-py2.7.egg-info

+ %{python3_sitelib}/gofedlib

+ %{python3_sitelib}/gofedlib-?.?.???-py?.?.egg-info

  %{_bindir}/gofedlib-cli

  

  %files resources

  %license LICENSE 

- %{python2_sitelib}/gofedresources

- %{python2_sitelib}/gofedresources-?.?.?-py2.7.egg-info

+ %{python3_sitelib}/gofedresources

+ %{python3_sitelib}/gofedresources-?.?.?-py?.?.egg-info

  

  %files infra

  %license LICENSE 

- %{python2_sitelib}/gofedinfra

- %{python2_sitelib}/gofedinfra-?.?.?-py2.7.egg-info

+ %{python3_sitelib}/gofedinfra

+ %{python3_sitelib}/gofedinfra-?.?.?-py?.?.egg-info

  

- %files -n python2-cmdsignature

+ %files -n python3-cmdsignature

  %license LICENSE 

- %{python2_sitelib}/cmdsignature

- %{python2_sitelib}/cmdsignature-?.?.?-py2.7.egg-info

+ %{python3_sitelib}/cmdsignature

+ %{python3_sitelib}/cmdsignature-?.?.?-py?.?.egg-info

  

  %files docker

  %{_bindir}/gofed-docker
@@ -381,6 +400,9 @@ 

  %{_datadir}/%{name}/*.py

  

  %changelog

+ * Thu Feb 28 2019 Robert-André Mauchin <zebob.m@gmail.com> - 1.0.0-0.23.rc1

+ - Rebuild with Python 3

+ 

  * Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 1.0.0-0.22.rc1

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

  
@@ -405,7 +427,7 @@ 

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

  

  * Sun Dec 17 2017 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 1.0.0-0.15.rc1

- - python-cmdsignature binary package is renamed to python2-cmdsignature

+ - python-cmdsignature binary package is renamed to python3-cmdsignature

  

  * Tue Nov 07 2017 Igor Gnatenko <ignatenko@redhat.com> - 1.0.0-0.14.rc1

  - Fix issues in packaging

@@ -0,0 +1,511 @@ 

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/config/config.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/config/config.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/config/config.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/config/config.py	2019-03-01 19:53:17.531050521 +0100

+ @@ -1,5 +1,5 @@

+  try:

+ -        import ConfigParser as configparser

+ +        import configparser as configparser

+  except:

+          import configparser

+  

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/koji/client.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/koji/client.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/koji/client.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/koji/client.py	2019-03-01 19:53:09.054058907 +0100

+ @@ -59,7 +59,7 @@ class KojiClient(object):

+  				"author": build_info["owner_name"],

+  				"name": build_info["nvr"],

+  				"architectures": list(set([x['arch']for x in build_rpms])),

+ -				"rpms": map(lambda rpm: "%s.%s.rpm" % (rpm['nvr'], rpm['arch']), build_rpms)

+ +				"rpms": ["%s.%s.rpm" % (rpm['nvr'], rpm['arch']) for rpm in build_rpms]

+  			}

+  

+  			builds[build_info["nvr"]] = build

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/koji/fakeclient.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/koji/fakeclient.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/koji/fakeclient.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/koji/fakeclient.py	2019-03-01 19:53:09.055058906 +0100

+ @@ -1,4 +1,4 @@

+ -from client import KojiClient

+ +from .client import KojiClient

+  import json

+  from lib.utils import getScriptDir

+  

+ @@ -18,7 +18,7 @@ class FakeKojiClient(object):

+  		return {

+  			"name": build["build"],

+  			"build_ts": build["build_ts"],

+ -			"rpms": map(lambda l: {"name": l}, build["rpms"])

+ +			"rpms": [{"name": l} for l in build["rpms"]]

+  		}

+  

+  	def getPackageBuilds(self, distribution, package, since = 0, to = 0):

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/koji/test_client.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/koji/test_client.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/koji/test_client.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/koji/test_client.py	2019-03-01 19:53:09.056058905 +0100

+ @@ -1,5 +1,5 @@

+  import unittest

+ -from fakeclient import FakeKojiClient

+ +from .fakeclient import FakeKojiClient

+  import json

+  from lib.utils import getScriptDir

+  

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/pkgdb/client.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/pkgdb/client.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/pkgdb/client.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/pkgdb/client.py	2019-03-01 19:53:09.056058905 +0100

+ @@ -4,20 +4,21 @@ from threading import Thread, enumerate

+  from time import sleep

+  

+  import logging

+ +from functools import reduce

+  logger = logging.getLogger("pkgdb_client")

+  

+  __all__ = ["PkgDBClient"]

+  

+  class Worker(Thread):

+ -    def __init__(self, url, package):

+ -        Thread.__init__(self)

+ -        self.url = url

+ -	self.package = package

+ -        self.response = None

+ -

+ -    def run(self):

+ -	params = {"pkgname": self.package}

+ -	self.response = requests.get(self.url, params=params)

+ +	def __init__(self, url, package):

+ +		Thread.__init__(self)

+ +		self.url = url

+ +		self.package = package

+ +		self.response = None

+ +

+ +	def run(self):

+ +		params = {"pkgname": self.package}

+ +		self.response = requests.get(self.url, params=params)

+  

+  class PkgDBClient(object):

+  

+ @@ -45,7 +46,7 @@ class PkgDBClient(object):

+  			worker.start()

+  

+  		while True:

+ -			running = map(lambda l: l.isAlive(), workers)

+ +			running = [l.isAlive() for l in workers]

+  			if not reduce(lambda a,b: a or b, running):

+  				break

+  

+ @@ -56,7 +57,7 @@ class PkgDBClient(object):

+  				branches[worker.package] = []

+  				continue

+  

+ -			branches[worker.package] = map(lambda l: l["collection"]["branchname"], worker.response.json()["packages"])

+ +			branches[worker.package] = [l["collection"]["branchname"] for l in worker.response.json()["packages"]]

+  

+  		return branches

+  

+ @@ -126,7 +127,7 @@ class PkgDBClient(object):

+  		# get branches of all packages

+  		MAX_LEN = 30

+  		# break the list of packages into lists of at most 50 packages

+ -		package_names = packages.keys()

+ +		package_names = list(packages.keys())

+  

+  		packages_total = len(package_names)

+  		packages_counter = 0

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/pkgdb/fakeclient.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/pkgdb/fakeclient.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/pkgdb/fakeclient.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/pkgdb/fakeclient.py	2019-03-01 19:53:09.057058904 +0100

+ @@ -1,4 +1,4 @@

+ -from client import PkgDBClient

+ +from .client import PkgDBClient

+  from lib.utils import getScriptDir

+  import json

+  

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/pkgdb/test_client.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/pkgdb/test_client.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/pkgdb/test_client.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/clients/pkgdb/test_client.py	2019-03-01 19:53:09.058058903 +0100

+ @@ -1,6 +1,6 @@

+  import unittest

+ -from fakeclient import FakePkgDBClient

+ -from client import PkgDBClient

+ +from .fakeclient import FakePkgDBClient

+ +from .client import PkgDBClient

+  import json

+  from lib.utils import getScriptDir

+  

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/distributionsnapshot.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/distributionsnapshot.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/distributionsnapshot.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/distributionsnapshot.py	2019-03-01 19:53:09.058058903 +0100

+ @@ -60,7 +60,7 @@ class DistributionSnapshot(object):

+  				"name": package,

+  				"build": self._builds[package]["build"],

+  				"build_ts": self._builds[package]["build_ts"],

+ -				"rpms": map(lambda l: l["name"], self._builds[package]["rpms"])

+ +				"rpms": [l["name"] for l in self._builds[package]["rpms"]]

+  			})

+  

+  		return {

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/eco/capturer.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/eco/capturer.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/eco/capturer.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/distribution/eco/capturer.py	2019-03-01 19:53:09.059058902 +0100

+ @@ -52,7 +52,7 @@ class EcoCapturer(object):

+  

+  			branch = collections[product][version]["branch"]

+  

+ -			scanned_packages = sorted(list(set(packages.keys() + custom_packages) - set(blacklist)))

+ +			scanned_packages = sorted(list(set(list(packages.keys()) + custom_packages) - set(blacklist)))

+  			scanned_packages_total = len(scanned_packages)

+  			scanned_packages_counter = 0

+  

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/contentmetadataextractor.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/contentmetadataextractor.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/contentmetadataextractor.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/contentmetadataextractor.py	2019-03-01 19:53:09.060058901 +0100

+ @@ -40,7 +40,7 @@ class ContentMetadataExtractor(object):

+  		# TODO(jchaloup): find licence check written in python

+  		so, se, rc = runCommand("licensecheck %s" % doc)

+  		if rc == 0:

+ -			return ":".join(so.split("\n")[0].split(":")[1:]).strip()

+ +			return ":".join(so.decode("utf-8").split("\n")[0].split(":")[1:]).strip()

+  		return "Unknown"

+  

+  	def _orNodes(self, node = ""):

+ @@ -95,7 +95,7 @@ class ContentMetadataExtractor(object):

+  				deps_dirs.append(dir)

+  

+  			# filter out all symlinks

+ -			subdirList = filter(lambda l: not os.path.islink(os.path.join(dirName, l)), subdirList)

+ +			subdirList = [l for l in subdirList if not os.path.islink(os.path.join(dirName, l))]

+  

+  			self._nodes[dir] = subdirList

+  			self._dirs_flag[dir] = False

+ @@ -120,17 +120,17 @@ class ContentMetadataExtractor(object):

+  				if self._isDoc(file):

+  					docs.append("%s/%s" % (dir, file))

+  			if self._dirs_flag[dir]:

+ -				dir_files[dir] = filter(lambda l: l.endswith(".go"), fileList)

+ +				dir_files[dir] = [l for l in fileList if l.endswith(".go")]

+  

+  		# detect known deps directory prefixes

+  		if self.check_deps_directory_prefixes:

+ -			deps_dirs = filter(lambda l: self._isKnownDepsDirectoryPrefix(l), deps_dirs)

+ +			deps_dirs = [l for l in deps_dirs if self._isKnownDepsDirectoryPrefix(l)]

+  

+  		# minimize deps directories

+  		deps_dirs = sorted(deps_dirs)

+  		min_deps_dirs = deps_dirs

+  		for dir in deps_dirs:

+ -			min_deps_dirs = filter(lambda l: l == dir or not l.startswith(dir), min_deps_dirs)

+ +			min_deps_dirs = [l for l in min_deps_dirs if l == dir or not l.startswith(dir)]

+  		self._deps_dirs = min_deps_dirs

+  

+  		# get go directories

+ @@ -168,8 +168,8 @@ class ContentMetadataExtractor(object):

+  					nodes.insert(0, node)

+  			nodes.pop()

+  

+ -		self.docs = map(lambda l: l[1:], docs)

+ -		self.non_go_directories = map(lambda l: l[1:], non_go_directories)

+ +		self.docs = [l[1:] for l in docs]

+ +		self.non_go_directories = [l[1:] for l in non_go_directories]

+  

+  	def depsDirectories(self):

+  		return self._deps_dirs

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/data2specmodeldata.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/data2specmodeldata.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/data2specmodeldata.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/data2specmodeldata.py	2019-03-01 19:53:09.061058900 +0100

+ @@ -34,19 +34,19 @@ class Data2SpecModelData(object):

+  		m_deps = deps

+  		for prefix in prefixes:

+  			prefix_len = len(prefix)

+ -			m_deps = map(lambda l: l[prefix_len:] if l.startswith(prefix) else l, m_deps)

+ +			m_deps = [l[prefix_len:] if l.startswith(prefix) else l for l in m_deps]

+  		return m_deps

+  

+  	def combine(self, metadata, project_packages, content_metadata):

+  		# metadata

+  		self.metadata = metadata

+  

+ -		dependency_directories = map(lambda l: "%s%s/" % (metadata["import_path"], l), content_metadata["metadata"]["dependency_directories"])

+ +		dependency_directories = ["%s%s/" % (metadata["import_path"], l) for l in content_metadata["metadata"]["dependency_directories"]]

+  

+  		# get packages

+  		self.packages = []

+  		for package in  project_packages["data"]["dependencies"]:

+ -			deps = self._filterOutNative(map(lambda l: l["name"], package["dependencies"]))

+ +			deps = self._filterOutNative([l["name"] for l in package["dependencies"]])

+  			# if dependency directory is on, filter out all imports prefixed with known dependency directory prefix

+  			if deps != [] and dependency_directories != []:

+  				deps = self._trimDependencyDirectoryPrefixes(dependency_directories, deps)

+ @@ -95,7 +95,7 @@ class Data2SpecModelData(object):

+  		self.skipped_directories = content_metadata["metadata"]["non_go_directories"]

+  

+  		# get dependency directories

+ -		self.dependency_directories = map(lambda l: l[1:] if l[0] == "/" else l, content_metadata["metadata"]["dependency_directories"])

+ +		self.dependency_directories = [l[1:] if l[0] == "/" else l for l in content_metadata["metadata"]["dependency_directories"]]

+  

+  	def getData(self):

+  		return {

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/projectinfo.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/projectinfo.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/projectinfo.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/projectinfo.py	2019-03-01 19:53:09.061058900 +0100

+ @@ -55,7 +55,7 @@ class ProjectInfo:

+  			for item in pkg["dependencies"]:

+  				dep = item["name"]

+  				if package != ".":

+ -					deps = map(lambda l: "%s/%s" % (package, l), item["location"])

+ +					deps = ["%s/%s" % (package, l) for l in item["location"]]

+  				else:

+  					deps = item["location"]

+  				if dep not in occurrences:

+ @@ -77,7 +77,7 @@ class ProjectInfo:

+  		self.main_occurrences = main_occurrences

+  	

+  		# test directories

+ -		self.test_directories = sorted(map(lambda l: l["test"], data["data"]["tests"]))

+ +		self.test_directories = sorted([l["test"] for l in data["data"]["tests"]])

+  

+  		# provided devel packages

+  		self.provided_packages = sorted(data["data"]["packages"])

+ @@ -100,4 +100,4 @@ class ProjectInfo:

+  		self.imported_native_packages = sorted(imported_native_packages)

+  

+  		# main packages

+ -		self.main_packages = map(lambda l: l["filename"], data["data"]["main"])

+ +		self.main_packages = [l["filename"] for l in data["data"]["main"]]

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/snapshot.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/snapshot.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/snapshot.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/snapshot.py	2019-03-01 19:53:09.062058899 +0100

+ @@ -75,7 +75,7 @@ class Snapshot(object):

+          }

+  

+          decomposer = ImportPathsDecomposerBuilder().buildLocalDecomposer()

+ -        decomposer.decompose(self._packages.keys())

+ +        decomposer.decompose(list(self._packages.keys()))

+          classes = decomposer.classes()

+  

+          for ipp in classes:

+ @@ -84,7 +84,7 @@ class Snapshot(object):

+                  "version": str(self._packages[classes[ipp][0]])

+              }

+              if len(classes[ipp]) > 1 or classes[ipp][0] != ipp:

+ -                dep["subpackages"] = map(lambda l: l[len(ipp)+1:], classes[ipp])

+ +                dep["subpackages"] = [l[len(ipp)+1:] for l in classes[ipp]]

+  

+              dict["imports"].append(dep)

+  

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/symbolsextractor/extractor.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/symbolsextractor/extractor.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/symbolsextractor/extractor.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/symbolsextractor/extractor.py	2019-03-01 19:53:18.509049553 +0100

+ @@ -93,17 +93,17 @@ class GoSymbolsExtractor(object):

+  		for key in self.package_imports:

+  			path = str(key.split(":")[0])

+  			qualifier = str(key.split(":")[1])

+ -			arr = sorted(map(lambda i: str(i), self.package_imports[key]))

+ +			arr = sorted([str(i) for i in self.package_imports[key]])

+  

+  			deps = []

+  			for dep in arr:

+ -				files = filter(lambda l: self._filterDeps(l, path), self.package_imports_occurence[dep])

+ +				files = [l for l in self.package_imports_occurence[dep] if self._filterDeps(l, path)]

+  				# filter out deps of main packages

+ -				files = filter(lambda l: l.split(":")[1] != "main", files)

+ +				files = [l for l in files if l.split(":")[1] != "main"]

+  

+ -				files = map(lambda l: os.path.basename(l.split(":")[0]), files)

+ +				files = [os.path.basename(l.split(":")[0]) for l in files]

+  				# filter out all test files

+ -				files = filter(lambda l: not l.endswith("_test.go"), files)

+ +				files = [l for l in files if not l.endswith("_test.go")]

+  

+  				if files == []:

+  					continue

+ @@ -124,7 +124,7 @@ class GoSymbolsExtractor(object):

+  		data["dependencies"] = package_imports

+  

+  		# list of defined packages (defined package has at least one exported symbol)

+ -		data["packages"] = map(lambda i: self._normalizePath(str(i.split(":")[0])), self.symbols.keys())

+ +		data["packages"] = [self._normalizePath(str(i.split(":")[0])) for i in list(self.symbols.keys())]

+  

+  		# list of tests

+  		test_objs = []

+ @@ -264,7 +264,7 @@ class GoSymbolsExtractor(object):

+  

+  				pname = go_file_json["pkgname"]

+  

+ -				go_file_json["imports"] = filter(lambda l: self._isValidPath(l["path"]), go_file_json["imports"])

+ +				go_file_json["imports"] = [l for l in go_file_json["imports"] if self._isValidPath(l["path"])]

+  

+  				for path in go_file_json["imports"]:

+  					if not self._isValidPath(path["path"]):

+ @@ -295,7 +295,7 @@ class GoSymbolsExtractor(object):

+  					if dir_key not in test_directory_dependencies:

+  						test_directory_dependencies[dir_key] = []

+  

+ -					test_directory_dependencies[dir_key] = test_directory_dependencies[dir_key] + map(lambda p: str(p["path"]), go_file_json["imports"])

+ +					test_directory_dependencies[dir_key] = test_directory_dependencies[dir_key] + [str(p["path"]) for p in go_file_json["imports"]]

+  					test_directories.append(dir_info['dir'])

+  					continue

+  

+ @@ -307,7 +307,7 @@ class GoSymbolsExtractor(object):

+  						main_key = "%s/%s" % (dir_info['dir'], go_file)

+  

+  					main_packages.append(main_key)

+ -					main_package_deps[main_key] = sorted(map(lambda p: str(p["path"]), go_file_json["imports"]))

+ +					main_package_deps[main_key] = sorted([str(p["path"]) for p in go_file_json["imports"]])

+  					continue

+  

+  				# all files in a directory must define the same package

+ @@ -325,7 +325,7 @@ class GoSymbolsExtractor(object):

+  				# build can contain two different prefixes

+  				# but with the same package name.

+  				prefix = dir_info["dir"] + ":" + pkg_name

+ -				i_paths = map(lambda i: i["path"], go_file_json["imports"])

+ +				i_paths = [i["path"] for i in go_file_json["imports"]]

+  				if prefix not in jsons:

+  					jsons[prefix] = [go_file_json]

+  					package_imports[prefix] = i_paths

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/symbolsextractor/test_symbolsextractor.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/symbolsextractor/test_symbolsextractor.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/symbolsextractor/test_symbolsextractor.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/go/symbolsextractor/test_symbolsextractor.py	2019-03-01 19:53:09.063058898 +0100

+ @@ -17,5 +17,5 @@ class GoSymbolsExtractorTest(unittest.Te

+  		e = GoSymbolsExtractor(source_code_directory).extract()

+  

+  		# TODO(jchaloup): validate the schema

+ -		self.assertNotEquals(e.packages(), {'main': [], 'tests': [], 'dependencies': [], 'packages': []})

+ -		self.assertNotEquals(e.exportedApi(), [])

+ +		self.assertNotEqual(e.packages(), {'main': [], 'tests': [], 'dependencies': [], 'packages': []})

+ +		self.assertNotEqual(e.exportedApi(), [])

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/graphs/graphutils.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/graphs/graphutils.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/graphs/graphutils.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/graphs/graphutils.py	2019-03-01 19:53:09.064058897 +0100

+ @@ -147,7 +147,7 @@ class GraphUtils(object):

+  	def filterGraph(graph, node_fnc):

+  		"""Remove all nodes for with node_fnc does not hold

+  		"""

+ -		nodes = filter(lambda l: node_fnc(l), graph.nodes())

+ +		nodes = [l for l in graph.nodes() if node_fnc(l)]

+  		edges = {}

+  

+  		gedges = graph.edges()

+ @@ -275,7 +275,7 @@ class DFS:

+  			return (self.f, self.d)

+  		else:

+  			start_nodes = []

+ -			for node, _ in sorted(f.items(), key=operator.itemgetter(1), reverse=True):

+ +			for node, _ in sorted(list(f.items()), key=operator.itemgetter(1), reverse=True):

+  				if self.color[node] == self.WHITE:

+  					self.DFSVisit(node)

+  				start_nodes.append(node)

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/graphs/test_graphutils.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/graphs/test_graphutils.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/graphs/test_graphutils.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/graphs/test_graphutils.py	2019-03-01 19:53:09.064058897 +0100

+ @@ -1,5 +1,5 @@

+  import unittest

+ -from graphutils import Graph, GraphUtils

+ +from .graphutils import Graph, GraphUtils

+  

+  class GraphUtilsTest(unittest.TestCase):

+  

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/projectsignature/parser.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/projectsignature/parser.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/projectsignature/parser.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/projectsignature/parser.py	2019-03-01 19:53:18.951049116 +0100

+ @@ -7,7 +7,7 @@

+  # - [distribution|distro]:product[:version]:ipprefix

+  #

+  

+ -from __future__ import print_function

+ +

+  

+  import re

+  from gofedlib.providers.providerbuilder import ProviderBuilder

+ @@ -76,6 +76,6 @@ class ProjectSignatureParser(object):

+  

+  if __name__ == "__main__":

+  	p = ProjectSignatureParser()

+ -	print(p.parse("upstream:github.com/coreos/etcd:434343"))

+ -	print(p.parse("upstream:github.com/coreos/etcd"))

+ -	print(p.parse("distro:Fedora:f23:gopkg.yaml/yaml.v1"))

+ +	print(p.parse("upstream:github.com/coreos/etcd:434343"))

+ +	print(p.parse("upstream:github.com/coreos/etcd"))

+ +	print(p.parse("distro:Fedora:f23:gopkg.yaml/yaml.v1"))

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/repository/bitbucketclient.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/repository/bitbucketclient.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/repository/bitbucketclient.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/repository/bitbucketclient.py	2019-03-01 19:53:09.065058896 +0100

+ @@ -26,7 +26,7 @@ class BitbucketClient(object):

+  		"""

+  		req_message = 'https://api.bitbucket.org/1.0/repositories/' + self.reponame + '/branches'

+  		response_data = self._bitbucketAPIRequest(req_message)

+ -		return response_data.keys()

+ +		return list(response_data.keys())

+  

+  	def _commitData(self, commit):

+  		"""Get data from a commit object

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/repository/gitlocalclient.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/repository/gitlocalclient.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/repository/gitlocalclient.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/repository/gitlocalclient.py	2019-03-01 19:53:09.066058895 +0100

+ @@ -19,16 +19,16 @@ class GitLocalClient(object):

+  		:return: [str]

+  		"""

+  		# get all remote branches

+ -		refs = filter(lambda l: isinstance(l, git.RemoteReference), self.repo.references)

+ +		refs = [l for l in self.repo.references if isinstance(l, git.RemoteReference)]

+  		# filter out HEAD branch

+ -		refs = filter(lambda l: l.name != "origin/HEAD", refs)

+ +		refs = [l for l in refs if l.name != "origin/HEAD"]

+  		# filter out all branches not starting with 'origin/'

+ -		refs = filter(lambda l: l.name.startswith("origin/"), refs)

+ +		refs = [l for l in refs if l.name.startswith("origin/")]

+  		for ref in refs:

+  			self.refs[ref.name[7:]] = ref

+  

+  		# remove 'origin/' prefix

+ -		return map(lambda l: l.name[7:], refs)

+ +		return [l.name[7:] for l in refs]

+  

+  	def _commitData(self, commit):

+  		"""Get data from a commit object

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/repository/mercuriallocalclient.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/repository/mercuriallocalclient.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/repository/mercuriallocalclient.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/repository/mercuriallocalclient.py	2019-03-01 19:53:19.289048782 +0100

+ @@ -1,4 +1,4 @@

+ -from __future__ import print_function

+ +

+  

+  import hglib

+  from hglib.util import b

+ @@ -27,7 +27,7 @@ class MercurialLocalClient(object):

+  		"""

+  		# TODO(jchaloup): find out of all branches are listed (even remote)

+  		# if there is a concept of remote branch

+ -		return map(lambda (b, r, n): b, self.repo.branches())

+ +		return list(map(lambda b, r, n: b, self.repo.branches()))

+  

+  	def _commitData(self, changeset):

+  		"""Get data from a commit object

+ @@ -91,4 +91,4 @@ if __name__ == "__main__":

+  	#commits = client.commits("default", since = 1305929843)

+  	#for commit in commits: #, since=1313487608):

+  	#	print commits[commit]["cdate"]

+ -	print(client.commit("848b351341922ce39becda978778724d5b58dbca"))

+ +	print(client.commit("848b351341922ce39becda978778724d5b58dbca"))

+ diff -up gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/urlbuilder/api.py.bak gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/urlbuilder/api.py

+ --- gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/urlbuilder/api.py.bak	2018-11-21 12:14:02.000000000 +0100

+ +++ gofedlib-0674c248fe3d8706f98f912996b65af469f96b10/gofedlib/urlbuilder/api.py	2019-03-01 19:53:19.417048655 +0100

+ @@ -1,7 +1,7 @@

+  #

+  # Call simple functions without knowing who actually provides the url construction algorithm

+  #

+ -from __future__ import print_function

+ +

+  

+  from .builder import UrlBuilder

+  

+ @@ -18,7 +18,7 @@ def koji_rpm_url(product, build, rpm):

+  	return UrlBuilder().buildKojiRpm(product, build, rpm)

+  

+  if __name__ == "__main__":

+ -	print(github_source_code_tarball_url("coreos", "etcd", "4041bbe571432b6bc4bdd0a5408d55aba545b040"))

+ -	print(github_repository_url("coreos", "etcd"))

+ -	print(bitbucket_repository_url("ww", "goautoneg"))

+ -	print(koji_rpm_url("Fedora", "etcd-2.3.1-1.fc25", "etcd-devel-2.3.1-1.fc25.noarch.rpm"))

+ +	print(github_source_code_tarball_url("coreos", "etcd", "4041bbe571432b6bc4bdd0a5408d55aba545b040"))

+ +	print(github_repository_url("coreos", "etcd"))

+ +	print(bitbucket_repository_url("ww", "goautoneg"))

+ +	print(koji_rpm_url("Fedora", "etcd-2.3.1-1.fc25", "etcd-devel-2.3.1-1.fc25.noarch.rpm"))

@@ -0,0 +1,841 @@ 

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/ansible/roles/gofedinfra/library/repositorycoderetriever.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/ansible/roles/gofedinfra/library/repositorycoderetriever.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/ansible/roles/gofedinfra/library/repositorycoderetriever.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/ansible/roles/gofedinfra/library/repositorycoderetriever.py	2019-03-01 18:38:02.397178507 +0100

+ @@ -17,7 +17,7 @@ EXAMPLES = '''

+  from ansible.module_utils.basic import *

+  from gofedlib.providers.providerbuilder import ProviderBuilder

+  from gofedlib.urlbuilder.builder import UrlBuilder

+ -import urllib2

+ +import urllib.request, urllib.error, urllib.parse

+  import tempfile

+  import tarfile

+  import os

+ @@ -69,15 +69,15 @@ class RepositoryCodeRetriever(object):

+          # TODO(jchaloup): catch exceptions: urllib2.URLError, urllib2.HTTPError

+          #    raise ResourceNotRetrieved instead?

+          try:

+ -            response = urllib2.urlopen(resource_url)

+ -        except urllib2.URLError as err:

+ +            response = urllib.request.urlopen(resource_url)

+ +        except urllib.error.URLError as err:

+              # can a user do something about it?

+              msg = "Unable to retrieve resource, url = %s, err = %s" % (resource_url, err)

+ -            raise urllib2.URLError(msg)

+ -        except urllib2.HTTPError as err:

+ +            raise urllib.error.URLError(msg)

+ +        except urllib.error.HTTPError as err:

+              # can a user do something about it?

+              msg = "Unable to retrieve resource, url = %s, err = %s" % (resource_url, err)

+ -            raise urllib2.HTTPError(msg)

+ +            raise urllib.error.HTTPError(msg)

+  

+          try:

+              with tempfile.NamedTemporaryFile(delete=False) as f:

+ @@ -126,10 +126,10 @@ def main():

+      errmsg = ""

+      try:

+          r.retrieve()

+ -    except urllib2.URLError as err:

+ +    except urllib.error.URLError as err:

+          failed = True

+          errmsg = err

+ -    except urllib2.HTTPError as err:

+ +    except urllib.error.HTTPError as err:

+          failed = True

+          errmsg = err

+      except ResourceUnableToRetrieveError as err:

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/ansible/roles/gofedinfra/library/repositorydataextractor.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/ansible/roles/gofedinfra/library/repositorydataextractor.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/ansible/roles/gofedinfra/library/repositorydataextractor.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/ansible/roles/gofedinfra/library/repositorydataextractor.py	2019-03-01 18:38:02.472178398 +0100

+ @@ -157,8 +157,8 @@ class RepositoryDataExtractor(object):

+  

+          # from all branches (up to master) filter out all commits that are already covered in master branch

+          if "master" in branches:

+ -            for branch in filter(lambda l: l != "master", branches.keys()):

+ -                for key in branches["master"].keys():

+ +            for branch in [l for l in list(branches.keys()) if l != "master"]:

+ +                for key in list(branches["master"].keys()):

+                      branches[branch].pop(key, None)

+  

+          self._info = self._generateGolangProjectRepositoryInfo(branches)

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/ansible/roles/gofedinfra/library/rpmretriever.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/ansible/roles/gofedinfra/library/rpmretriever.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/ansible/roles/gofedinfra/library/rpmretriever.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/ansible/roles/gofedinfra/library/rpmretriever.py	2019-03-01 18:38:02.531178312 +0100

+ @@ -2,7 +2,7 @@

+  

+  from ansible.module_utils.basic import *

+  

+ -import urllib2

+ +import urllib.request, urllib.error, urllib.parse

+  import tempfile

+  import os

+  from gofedlib.utils import runCommand

+ @@ -23,15 +23,15 @@ class RpmRetriever(object):

+          # TODO(jchaloup): catch exceptions: urllib2.URLError, urllib2.HTTPError

+          #    raise ResourceNotRetrieved instead?

+          try:

+ -            response = urllib2.urlopen(resource_url)

+ -        except urllib2.URLError as err:

+ +            response = urllib.request.urlopen(resource_url)

+ +        except urllib.error.URLError as err:

+              # can a user do something about it?

+              msg = "Unable to retrieve resource, url = %s, err = %s" % (resource_url, err)

+ -            raise urllib2.URLError(msg)

+ -        except urllib2.HTTPError as err:

+ +            raise urllib.error.URLError(msg)

+ +        except urllib.error.HTTPError as err:

+              # can a user do something about it?

+              msg = "Unable to retrieve resource, url = %s, err = %s" % (resource_url, err)

+ -            raise urllib2.HTTPError(msg)

+ +            raise urllib.error.HTTPError(msg)

+  

+          try:

+              with tempfile.NamedTemporaryFile(delete=False) as f:

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/builddepgraph.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/builddepgraph.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/builddepgraph.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/builddepgraph.py	2019-03-01 18:38:05.259174342 +0100

+ @@ -52,12 +52,12 @@ if __name__ == "__main__":

+  	dataset = LocalProjectDatasetBuilder("/home/jchaloup/Packages/etcd/fedora/etcd/etcd-5e6eb7e19d6385adfabb1f1caea03e732f9348ad", "github.com/coreos/etcd").build()

+  

+  	graph = DatasetDependencyGraphBuilder().build(dataset, 2)

+ -	#print str(graph)

+ +	#print(str(graph))

+  

+  	# get a subgraph

+ -	#print str(GraphUtils.truncateGraph(graph, ["kubernetes-devel-1.2.0-0.15.alpha6.gitf0cd09a.fc25.noarch.rpm"]))

+ +	#print(str(GraphUtils.truncateGraph(graph, ["kubernetes-devel-1.2.0-0.15.alpha6.gitf0cd09a.fc25.noarch.rpm"])))

+  

+ -	print json.dumps(BasicDependencyAnalysis(graph).analyse().getResults())

+ +	print(json.dumps(BasicDependencyAnalysis(graph).analyse().getResults()))

+  

+  	#DatasetBuilder("DistributionLatestBuild").\

+  	#	build("rawhide", packages).\

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/generators/artefactkeys.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/generators/artefactkeys.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/generators/artefactkeys.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/generators/artefactkeys.py	2019-03-01 18:38:02.602178209 +0100

+ @@ -78,4 +78,4 @@ if __name__ == "__main__":

+  		class_def = generateKeyClass(key)

+  		with open("gofedinfra/system/helpers/artefactkeygenerator/%s" % obj.class_filename_ext(), "w") as f:

+  			f.write(class_def)

+ -			print("gofedinfra/system/helpers/artefactkeygenerator/%s" % obj.class_filename_ext())

+ +			print("gofedinfra/system/helpers/artefactkeygenerator/%s" % obj.class_filename_ext())

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/generators/artefactreaderschema.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/generators/artefactreaderschema.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/generators/artefactreaderschema.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/generators/artefactreaderschema.py	2019-03-01 18:38:02.625178176 +0100

+ @@ -59,4 +59,4 @@ if __name__ == "__main__":

+  		"definitions": definitions

+  	}

+  

+ -	print json.dumps(schema, indent = 4)

+ +	print(json.dumps(schema, indent = 4))

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/generators/classhelper.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/generators/classhelper.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/generators/classhelper.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/generators/classhelper.py	2019-03-01 18:38:02.611178196 +0100

+ @@ -5,7 +5,7 @@ class ClassHelper:

+  		self._generate()

+  

+  	def _generate(self):

+ -		self._class_name = "".join(map(lambda i: i.capitalize(), self.key_spec["id"].split("-")))

+ +		self._class_name = "".join([i.capitalize() for i in self.key_spec["id"].split("-")])

+  		self._class_keys = '["' + '", "'.join(self.key_spec["keys"]) + '"]'

+  		self._class_filename_ext = "%s.py" % self.key_spec["id"].replace("-", "")

+  		self._class_filename = self.key_spec["id"].replace("-", "")

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/acts/scandistributionpackage/act.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/acts/scandistributionpackage/act.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/acts/scandistributionpackage/act.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/acts/scandistributionpackage/act.py	2019-03-01 18:38:02.983177654 +0100

+ @@ -133,7 +133,7 @@ class ScanDistributionPackageAct(MetaAct

+  			"distribution": self.distribution,

+  			"package": self.package,

+  			"coverage": itemsetcache.intervals(),

+ -			"builds": itemsetcache.items()

+ +			"builds": list(itemsetcache.items())

+  		}

+  

+  	def _mergeItemSetInfoArtefacts(self, info1, info2, coverage):

+ @@ -207,7 +207,7 @@ class ScanDistributionPackageAct(MetaAct

+  			return {}

+  

+  		items = {}

+ -		for item in filter(lambda l: l["point"] >= start and l["point"] <= end, cache["builds"]):

+ +		for item in [l for l in cache["builds"] if l["point"] >= start and l["point"] <= end]:

+  			# construct a storage request for each item

+  			data = {

+  				"artefact": ARTEFACT_GOLANG_PROJECT_DISTRIBUTION_BUILD,

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/acts/scanupstreamrepository/act.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/acts/scanupstreamrepository/act.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/acts/scanupstreamrepository/act.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/acts/scanupstreamrepository/act.py	2019-03-01 18:38:03.109177471 +0100

+ @@ -197,7 +197,7 @@ class ScanUpstreamRepositoryAct(MetaAct)

+  			"artefact": ARTEFACT_CACHE_GOLANG_PROJECT_REPOSITORY_COMMITS,

+  			"repository": self.repository,

+  			"coverage": itemsetcache.intervals(),

+ -			"commits": itemsetcache.items()

+ +			"commits": list(itemsetcache.items())

+  		}

+  

+  	def _mergeItemSetInfoArtefacts(self, info1, info2, coverage):

+ @@ -295,7 +295,7 @@ class ScanUpstreamRepositoryAct(MetaAct)

+  		return items

+  

+  	def _truncateRepositoryInfoArtefact(self, info, branches):

+ -		info["branches"] = filter(lambda l: l["branch"] in branches, info["branches"])

+ +		info["branches"] = [l for l in info["branches"] if l["branch"] in branches]

+  		return info

+  

+  	def _retrieveItemsFromCache(self, cache, info, start, end):

+ @@ -314,7 +314,7 @@ class ScanUpstreamRepositoryAct(MetaAct)

+  				return {}

+  

+  		items = {}

+ -		for item in filter(lambda l: l["point"] >= start and l["point"] <= end, cache["commits"]):

+ +		for item in [l for l in cache["commits"] if l["point"] >= start and l["point"] <= end]:

+  			if self.branch != "":

+  				# commit in a given branch?

+  				if item["item"] not in branch_commits:

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/acts/scanupstreamrepository/fakeact.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/acts/scanupstreamrepository/fakeact.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/acts/scanupstreamrepository/fakeact.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/acts/scanupstreamrepository/fakeact.py	2019-03-01 18:38:03.121177453 +0100

+ @@ -21,6 +21,6 @@ class FakeScanUpstreamRepositoryAct(Scan

+  			self._items = json.load(f)

+  

+  		if self.commit != "":

+ -			self._items[self.commit] = self._items[self._items.keys()[-1]]

+ +			self._items[self.commit] = self._items[list(self._items.keys())[-1]]

+  

+  		return True

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/core/meta/metaartefactkeygenerator.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/core/meta/metaartefactkeygenerator.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/core/meta/metaartefactkeygenerator.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/core/meta/metaartefactkeygenerator.py	2019-03-01 18:38:03.346177126 +0100

+ @@ -18,7 +18,7 @@ class MetaArtefactKeyGenerator:

+  		return re.sub('[^a-zA-Z0-9:-]', '-', key)

+  

+  	def value2key(self, value, delimiter, key, key_order):

+ -		if type(value) in [type(""), type(u"")]:

+ +		if type(value) in [type(""), type("")]:

+  			return [self.truncateKey(value)]

+  

+  		if type(value) != type({}):

+ @@ -29,7 +29,7 @@ class MetaArtefactKeyGenerator:

+  			if vkey not in value:

+  				raise ValueError("%s key missing" % vkey)

+  

+ -			if type(value[vkey]) != type("") and type(value[vkey]) != type(u""):

+ +			if type(value[vkey]) != type("") and type(value[vkey]) != type(""):

+  				raise ValueError("Second level value is not string")

+  

+  			keys.append(self.truncateKey(value[vkey]))

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/artefactdecomposer.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/artefactdecomposer.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/artefactdecomposer.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/artefactdecomposer.py	2019-03-01 18:38:03.446176981 +0100

+ @@ -166,12 +166,12 @@ class ArtefactDecomposer:

+  				test_classes[key] = [test]

+  

+  		# nonempty list of classes must be the same for all parts

+ -		classes_len = filter(lambda l: l > 0, [len(pkg_classes.keys()), len(dep_classes.keys()), len(main_classes.keys()), len(test_classes.keys())])

+ +		classes_len = [l for l in [len(list(pkg_classes.keys())), len(list(dep_classes.keys())), len(list(main_classes.keys())), len(list(test_classes.keys()))] if l > 0]

+  		if max(classes_len) != min(classes_len):

+  			raise ValueError("Not every data belongs to the same set of classes")

+  

+  		# collect common classes

+ -		classes_keys = filter(lambda l: l != [], [pkg_classes.keys(), dep_classes.keys(), main_classes.keys(), test_classes.keys()])

+ +		classes_keys = [l for l in [list(pkg_classes.keys()), list(dep_classes.keys()), list(main_classes.keys()), list(test_classes.keys())] if l != []]

+  		if classes_keys == []:

+  			raise ValueError("No prefix class detected")

+  

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/cacheintervalmerger.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/cacheintervalmerger.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/cacheintervalmerger.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/cacheintervalmerger.py	2019-03-01 18:38:03.645176691 +0100

+ @@ -8,7 +8,7 @@ class CacheIntervalBreaker(object):

+  	def decompose(self, stored_commits, not_stored_commits):

+  		commits = stored_commits + not_stored_commits

+  		commits = sorted(commits, key = lambda commit: commit["d"])

+ -		commits = map(lambda l: {"c": "", "d": l["d"]} if l in not_stored_commits else l, commits)

+ +		commits = [{"c": "", "d": l["d"]} if l in not_stored_commits else l for l in commits]

+  

+  		# decompose

+  		commits_len = len(commits)

+ @@ -103,13 +103,13 @@ class CacheIntervalMerger(object):

+  					n_intervals[i] = {}

+  

+  			# filter out all empty intervals

+ -			n_intervals = filter(lambda l: l != {}, n_intervals)

+ +			n_intervals = [l for l in n_intervals if l != {}]

+  

+  			if not overlap:

+  				break

+  

+  			interval_count = len(n_intervals)

+ -			for i in reversed(range(1, interval_count)):

+ +			for i in reversed(list(range(1, interval_count))):

+  				if n_intervals[i] == {}:

+  					continue

+  

+ @@ -119,6 +119,6 @@ class CacheIntervalMerger(object):

+  					n_intervals[i] = {}

+  

+  			# filter out all empty intervals

+ -			n_intervals = filter(lambda l: l != {}, n_intervals)

+ +			n_intervals = [l for l in n_intervals if l != {}]

+  

+  		return n_intervals

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/itemsetcache/itemsetcache.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/itemsetcache/itemsetcache.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/itemsetcache/itemsetcache.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/itemsetcache/itemsetcache.py	2019-03-01 18:38:03.688176628 +0100

+ @@ -62,7 +62,7 @@ class CoverageIntervalBreaker(object):

+  	def decompose(self, interval, breakpoints):

+  		items = interval + breakpoints

+  		items = sorted(items, key = lambda item: item["point"])

+ -		items = map(lambda l: {"item": "", "point": l["point"]} if l in breakpoints else l, items)

+ +		items = [{"item": "", "point": l["point"]} if l in breakpoints else l for l in items]

+  

+  		# decompose

+  		items_len = len(items)

+ @@ -154,13 +154,13 @@ class CoverageIntervalMerger(object):

+  					n_intervals[i] = {}

+  

+  			# filter out all empty intervals

+ -			n_intervals = filter(lambda l: l != {}, n_intervals)

+ +			n_intervals = [l for l in n_intervals if l != {}]

+  

+  			if not overlap:

+  				break

+  

+  			interval_count = len(n_intervals)

+ -			for i in reversed(range(1, interval_count)):

+ +			for i in reversed(list(range(1, interval_count))):

+  				if n_intervals[i] == {}:

+  					continue

+  

+ @@ -170,7 +170,7 @@ class CoverageIntervalMerger(object):

+  					n_intervals[i] = {}

+  

+  			# filter out all empty intervals

+ -			n_intervals = filter(lambda l: l != {}, n_intervals)

+ +			n_intervals = [l for l in n_intervals if l != {}]

+  

+  		return n_intervals

+  

+ @@ -191,8 +191,8 @@ if __name__ == "__main__":

+  

+  	cache = ItemSetCache().addItems(intervals1, breakpoints1)

+  

+ -	print cache.intervals()

+ -	print cache.items()

+ +	print(cache.intervals())

+ +	print(list(cache.items()))

+  

+  	intervals2 = [

+  		{"item": "g", "point": 17},

+ @@ -208,8 +208,8 @@ if __name__ == "__main__":

+  

+  	cache.addItems(intervals2, breakpoints2)

+  

+ -	print cache.intervals()

+ -	print cache.items()

+ +	print(cache.intervals())

+ +	print(list(cache.items()))

+  

+ -	print ""

+ -	print cache.cache()

+ +	print("")

+ +	print(cache.cache())

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/jsoncomparator.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/jsoncomparator.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/jsoncomparator.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/jsoncomparator.py	2019-03-01 18:38:03.692176622 +0100

+ @@ -11,7 +11,7 @@ class DirectJSONComparator:

+  		if left_diff != [] or right_diff != []:

+  			return False

+  

+ -		for key in json1.keys():

+ +		for key in list(json1.keys()):

+  			if json1[key] != json2[key]:

+  				return False

+  

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/schema_validator.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/schema_validator.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/schema_validator.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/schema_validator.py	2019-03-01 17:35:11.440202601 +0100

+ @@ -13,7 +13,7 @@ class SchemaValidator:

+  		try:

+  			with open(schema_file, "r") as f:

+  				schema = json.load(f)

+ - 		except IOError as e:

+ +		except IOError as e:

+  			logging.error("Unable to load schema from %s" % schema_file)

+  			return False

+  

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/utils.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/utils.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/utils.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/helpers/utils.py	2019-03-01 18:38:03.726176573 +0100

+ @@ -84,7 +84,7 @@ def format_output(fmt, out, fancy = Fals

+  

+  	def normal_format_str(fmt):

+  		try:

+ -			ret = ''.join(['{} ' for num in xrange(len(fmt))])

+ +			ret = ''.join(['{} ' for num in range(len(fmt))])

+  		except NameError:

+  			ret = ''.join(['{} ' for num in range(len(fmt))])

+  		return ret[:-1] # omit space at the end of line

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/ecosnapshots/distributionsnapshotchecker.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/ecosnapshots/distributionsnapshotchecker.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/ecosnapshots/distributionsnapshotchecker.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/ecosnapshots/distributionsnapshotchecker.py	2019-03-01 18:38:03.812176448 +0100

+ @@ -60,8 +60,8 @@ class DistributionSnapshotChecker(object

+  		index = 1

+  		for package in snapshot.json()["builds"]:

+  			# scan devel and unit-tests only

+ -			rpms = filter(lambda l: GolangRpm(package["build"], l).provideSourceCode(), package["rpms"])

+ -			print(package["rpms"])

+ +			rpms = [l for l in package["rpms"] if GolangRpm(package["build"], l).provideSourceCode()]

+ +			print(package["rpms"])

+  

+  			if rpms == []:

+  				continue

+ @@ -71,7 +71,7 @@ class DistributionSnapshotChecker(object

+  				"distribution": version,

+  				"build": {

+  					"name": package["build"],

+ -					"rpms": map(lambda l: {"name": l}, rpms)

+ +					"rpms": [{"name": l} for l in rpms]

+  				}

+  			}

+  

+ @@ -121,7 +121,7 @@ class DistributionSnapshotChecker(object

+  			except KeyError:

+  				continue

+  

+ -			distro_packages = distro_packages + DistributionSnapshot().read(data).builds().keys()

+ +			distro_packages = distro_packages + list(DistributionSnapshot().read(data).builds().keys())

+  

+  		known_packages = list(set(distro_packages + custom_packages))

+  

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/graphs/datasetdependencygraphbuilder.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/graphs/datasetdependencygraphbuilder.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/graphs/datasetdependencygraphbuilder.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/graphs/datasetdependencygraphbuilder.py	2019-03-01 18:38:03.997176178 +0100

+ @@ -29,7 +29,7 @@ class DatasetDependencyGraphBuilder(obje

+  			for edge in labels[category]:

+  				a, b = edge

+  				if b == "":

+ -					missing = missing + list(set(map(lambda (a,b): b, labels[category][edge])))

+ +					missing = missing + list(set(map(lambda a,b: b, labels[category][edge])))

+  

+  		self._missing_packages = list(set(missing))

+  

+ @@ -39,7 +39,7 @@ class DatasetDependencyGraphBuilder(obje

+  		# find the corresponding rpm

+  		if root_package != "":

+  			root_rpm = ""

+ -			for rpm_sig in dataset.parents().values():

+ +			for rpm_sig in list(dataset.parents().values()):

+  				if Build(rpm_sig["build"]).name() == root_package:

+  					root_rpm = rpm_sig["rpm"]

+  					break

+ @@ -66,7 +66,7 @@ class DatasetDependencyGraphBuilder(obje

+  			for edge in labels[category]:

+  				a, b = edge

+  				if b == "":

+ -					missing = missing + list(set(map(lambda (a,b): b, labels[category][edge])))

+ +					missing = missing + list(set(map(lambda a,b: b, labels[category][edge])))

+  				else:

+  					edges = edges + labels[category][edge]

+  

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/graphs/datasets/datasetbuilder.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/graphs/datasets/datasetbuilder.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/graphs/datasets/datasetbuilder.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/graphs/datasets/datasetbuilder.py	2019-03-01 18:38:03.962176229 +0100

+ @@ -67,7 +67,7 @@ class DatasetBuilder(object):

+  		# edges

+  		edges[node_name]["devel"] = []

+  		for dependencies in artefact["data"]["dependencies"]:

+ -			edges[node_name]["devel"] = edges[node_name]["devel"] + map(lambda l: (self._prefixPackage(artefact["ipprefix"], dependencies["package"]), l["name"]), dependencies["dependencies"])

+ +			edges[node_name]["devel"] = edges[node_name]["devel"] + [(self._prefixPackage(artefact["ipprefix"], dependencies["package"]), l["name"]) for l in dependencies["dependencies"]]

+  

+  		# main packages

+  		vertices[node_name]["main"] = []

+ @@ -76,7 +76,7 @@ class DatasetBuilder(object):

+  			# dirname from filename says in which package the dependencies are required/imported

+  			pkg = os.path.dirname(main["filename"])

+  			vertices[node_name]["main"].append("%s/%s" % (artefact["ipprefix"], pkg))

+ -			edges[node_name]["main"] = edges[node_name]["main"] + map(lambda l: (self._prefixPackage(artefact["ipprefix"], pkg), l),  main["dependencies"])

+ +			edges[node_name]["main"] = edges[node_name]["main"] + [(self._prefixPackage(artefact["ipprefix"], pkg), l) for l in main["dependencies"]]

+  		# one directory can have multiple filename import the same package

+  		edges[node_name]["main"] = list(set(edges[node_name]["main"]))

+  

+ @@ -85,7 +85,7 @@ class DatasetBuilder(object):

+  		edges[node_name]["tests"] = []

+  		for test in artefact["data"]["tests"]:

+  			vertices[node_name]["tests"].append("%s/%s" % (artefact["ipprefix"], test["test"]))

+ -			edges[node_name]["tests"] = edges[node_name]["tests"] + map(lambda l: (self._prefixPackage(artefact["ipprefix"], test["test"]), l),  test["dependencies"])

+ +			edges[node_name]["tests"] = edges[node_name]["tests"] + [(self._prefixPackage(artefact["ipprefix"], test["test"]), l) for l in test["dependencies"]]

+  

+  		return (vertices, edges)

+  

+ @@ -110,7 +110,7 @@ class DatasetBuilder(object):

+  			# edges

+  			edges[node_name]["devel"] = []

+  			for dependencies in prefix_unit["dependencies"]:

+ -				edges[node_name]["devel"] = edges[node_name]["devel"] + map(lambda l: (dependencies["package"], l["name"]), dependencies["dependencies"])

+ +				edges[node_name]["devel"] = edges[node_name]["devel"] + [(dependencies["package"], l["name"]) for l in dependencies["dependencies"]]

+  

+  			# main packages

+  			vertices[node_name]["main"] = []

+ @@ -119,7 +119,7 @@ class DatasetBuilder(object):

+  				# dirname from filename says in which package the dependencies are required/imported

+  				pkg = os.path.dirname(main["filename"])

+  				vertices[node_name]["main"].append(pkg)

+ -				edges[node_name]["main"] = edges[node_name]["main"] + map(lambda l: (pkg, l),  main["dependencies"])

+ +				edges[node_name]["main"] = edges[node_name]["main"] + [(pkg, l) for l in main["dependencies"]]

+  			# one directory can have multiple filename import the same package

+  			edges[node_name]["main"] = list(set(edges[node_name]["main"]))

+  

+ @@ -128,7 +128,7 @@ class DatasetBuilder(object):

+  			edges[node_name]["tests"] = []

+  			for test in prefix_unit["tests"]:

+  				vertices[node_name]["tests"].append(test["test"])

+ -				edges[node_name]["tests"] = edges[node_name]["tests"] + map(lambda l: (test["test"], l),  test["dependencies"])

+ +				edges[node_name]["tests"] = edges[node_name]["tests"] + [(test["test"], l) for l in test["dependencies"]]

+  

+  		return (vertices, edges)

+  

+ @@ -187,7 +187,7 @@ class DatasetBuilder(object):

+  							target_rpm = parents[b]["rpm"]

+  							edges.append((rpm, target_rpm))

+  						except KeyError:

+ -							#print "Missing node: %s" % b

+ +							#print("Missing node: %s" % b)

+  							target_rpm = ""

+  

+  						# labels

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/graphs/datasets/distributionlatestbuilds.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/graphs/datasets/distributionlatestbuilds.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/graphs/datasets/distributionlatestbuilds.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/graphs/datasets/distributionlatestbuilds.py	2019-03-01 18:38:03.862176375 +0100

+ @@ -86,7 +86,7 @@ class DistributionLatestBuildGraphDatase

+  				"distribution": distribution.version(),

+  				"build": {

+  					"name": builds[pkg]["build"],

+ -					"rpms": map(lambda l: {"name": l}, builds[pkg]["rpms"])

+ +					"rpms": [{"name": l} for l in builds[pkg]["rpms"]]

+  				}

+  			}

+  

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/snapshots/checker.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/snapshots/checker.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/snapshots/checker.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/snapshots/checker.py	2019-03-01 18:38:04.137175975 +0100

+ @@ -177,11 +177,11 @@ class SnapshotChecker(object):

+  

+  		for ipprefix in ipprefixes:

+  			if ipprefix not in providers:

+ -				print "%sUnable to find provider for '%s' ipprefix%s" % (WHITE, ipprefix, ENDC)

+ +				print("%sUnable to find provider for '%s' ipprefix%s" % (WHITE, ipprefix, ENDC))

+  				continue

+  

+  			if ipprefix not in rpms:

+ -				print "%sUnable to find ipprefix2rpm mapping '%s' ipprefix%s" % (WHITE, ipprefix, ENDC)

+ +				print("%sUnable to find ipprefix2rpm mapping '%s' ipprefix%s" % (WHITE, ipprefix, ENDC))

+  				continue

+  

+  			upstream_commit = self._getCommitDate(providers[ipprefix], upstream[ipprefix])

+ @@ -207,10 +207,10 @@ class SnapshotChecker(object):

+  				not_covered = self._checkPackageCoverage(product, distribution, rpms[ipprefix]["build"], rpms[ipprefix]["rpm"], ipprefix, ipprefixes[ipprefix])

+  			except ActFailedError:

+  				logging.error("golang-project-packages artefact for '%s' not retrieved" % ipprefix)

+ -				print "%s: %scoverage unknown%s" % (comparison, RED, ENDC)

+ +				print("%s: %scoverage unknown%s" % (comparison, RED, ENDC))

+  				continue

+  

+  			if not_covered != []:

+ -				print "%s: %snot covered: %s%s" % (comparison, RED, not_covered, ENDC)

+ +				print("%s: %snot covered: %s%s" % (comparison, RED, not_covered, ENDC))

+  			else:

+ -				print comparison

+ +				print(comparison)

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/snapshots/reconstructor.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/snapshots/reconstructor.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/snapshots/reconstructor.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/models/snapshots/reconstructor.py	2019-03-01 18:38:04.092176040 +0100

+ @@ -61,7 +61,7 @@ class SnapshotReconstructor(object):

+  

+  	def _findYoungestCommits(self, commits):

+  		# sort commits

+ -		commits = map(lambda l: {"c": l, "d": commits[l]["cdate"]}, commits)

+ +		commits = [{"c": l, "d": commits[l]["cdate"]} for l in commits]

+  		commits = sorted(commits, key = lambda commit: commit["d"])

+  

+  		return commits[-1]

+ @@ -107,7 +107,7 @@ class SnapshotReconstructor(object):

+  					potential_commits[commit] = branch["commits"][commit]

+  

+  			if potential_commits:

+ -				sorted_commits = sorted(potential_commits.items(), key=operator.itemgetter(1))

+ +				sorted_commits = sorted(list(potential_commits.items()), key=operator.itemgetter(1))

+  				c, _ = sorted_commits[-1]

+  				return c

+  

+ @@ -117,7 +117,7 @@ class SnapshotReconstructor(object):

+  		dependencies = list(set(dependencies))

+  		# normalize paths

+  		normalizer = ImportPathNormalizer()

+ -		dependencies = map(lambda l: normalizer.normalize(l), dependencies)

+ +		dependencies = [normalizer.normalize(l) for l in dependencies]

+  

+  		decomposer = ImportPathsDecomposerBuilder().buildLocalDecomposer()

+  		decomposer.decompose(dependencies)

+ @@ -172,7 +172,7 @@ class SnapshotReconstructor(object):

+  			# update packages to scan

+  			next_projects[prefix] = {

+  				"ipprefix": prefix,

+ -				"paths": map(lambda l: str(l), prefix_classes[prefix]),

+ +				"paths": [str(l) for l in prefix_classes[prefix]],

+  				"provider": provider,

+  				"commit": closest_commit,

+  				"provider_prefix": provider_prefix

+ @@ -200,7 +200,7 @@ class SnapshotReconstructor(object):

+  		# collect dependencies

+  		direct_dependencies = []

+  		for package in packages_artefact["data"]["dependencies"]:

+ -			direct_dependencies = direct_dependencies + map(lambda l: l["name"], package["dependencies"])

+ +			direct_dependencies = direct_dependencies + [l["name"] for l in package["dependencies"]]

+  

+  		if mains != []:

+  			paths = {}

+ @@ -214,7 +214,7 @@ class SnapshotReconstructor(object):

+  				direct_dependencies = direct_dependencies + paths[main]

+  

+  		if tests:

+ -			for dependencies in map(lambda l: l["dependencies"], packages_artefact["data"]["tests"]):

+ +			for dependencies in [l["dependencies"] for l in packages_artefact["data"]["tests"]]:

+  				direct_dependencies = direct_dependencies + dependencies

+  

+  		# remove duplicates

+ @@ -252,7 +252,7 @@ class SnapshotReconstructor(object):

+  			subgraph = GraphUtils.truncateGraph(graph, self.unscanned_projects[prefix]["paths"])

+  

+  			# get dependencies from the subgraph

+ -			package_nodes = filter(lambda l: l.startswith(self.unscanned_projects[prefix]["ipprefix"]), subgraph.nodes())

+ +			package_nodes = [l for l in subgraph.nodes() if l.startswith(self.unscanned_projects[prefix]["ipprefix"])]

+  			label_edges = dataset.getLabelEdges()

+  			for node in package_nodes:

+                                  # package that does not import any other package has no edge -> the label_edges[node] does not exist then

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/distributionpackagebuildsextractor/extractor.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/distributionpackagebuildsextractor/extractor.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/distributionpackagebuildsextractor/extractor.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/distributionpackagebuildsextractor/extractor.py	2019-03-01 18:38:04.227175844 +0100

+ @@ -104,7 +104,7 @@ class DistributionPackageBuildsExtractor

+  		artefact["package"] = self.package

+  		artefact["product"] = self.product

+  		artefact["distribution"] = self.distribution

+ -		artefact["builds"] = self.builds.keys()

+ +		artefact["builds"] = list(self.builds.keys())

+  

+  		start_ts = self.end_ts

+  		end_ts = self.start_ts

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/repositorydataextractor/extractor.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/repositorydataextractor/extractor.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/repositorydataextractor/extractor.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/repositorydataextractor/extractor.py	2019-03-01 18:38:04.450175519 +0100

+ @@ -123,7 +123,7 @@ class RepositoryDataExtractor(MetaProces

+  

+  		# from all branches (up to master) filter out all commits that are already covered in master branch

+  		if "master" in branches:

+ -			for branch in filter(lambda l: l != "master", branches.keys()):

+ +			for branch in [l for l in list(branches.keys()) if l != "master"]:

+  				branches[branch] = list(set(branches[branch]) - set(branches["master"]))

+  

+  		# TODO(jchaloup): move validation to unit-tests

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/simplefilestorage/artefactdriver.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/simplefilestorage/artefactdriver.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/simplefilestorage/artefactdriver.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/simplefilestorage/artefactdriver.py	2019-03-01 17:58:57.877895472 +0100

+ @@ -1,4 +1,5 @@

+  import logging

+ +from functools import reduce

+  logger = logging.getLogger("simple_file_storage")

+  

+  from infra.system.core.meta.metaartefactdriver import MetaArtefactDriver

+ @@ -61,7 +62,7 @@ class ArtefactDriver(object):

+  		#except IOError as e:

+  

+  		# TODO(jchaloup): check if the file exists, if so, lock it?

+ -		with file(os.path.join(data_path, "data.json"), "w") as f:

+ +		with open(os.path.join(data_path, "data.json"), "w") as f:

+  			json.dump(data, f)

+  		# it is okay to ignore IOError exception

+  

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/specdataextractor/SpecParser.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/specdataextractor/SpecParser.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/specdataextractor/SpecParser.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/gofedinfra/system/plugins/specdataextractor/SpecParser.py	2019-03-01 18:38:04.780175039 +0100

+ @@ -85,7 +85,7 @@ class SpecParser:

+          # Otherwise return None

+          devel = ""

+          devel_counter = 0

+ -        subpkg_keys = self.subpackages.keys()

+ +        subpkg_keys = list(self.subpackages.keys())

+          for key in subpkg_keys:

+              if key.endswith('devel'):

+                  devel = key

+ @@ -145,7 +145,7 @@ class SpecParser:

+          return self.changelogs[0]

+  

+      def getSubpackages(self):

+ -        return self.subpackages.keys()

+ +        return list(self.subpackages.keys())

+  

+      def getProvides(self):

+          if self.subpackages == {}:

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/runscan.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/runscan.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/runscan.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/runscan.py	2019-03-01 18:38:05.283174307 +0100

+ @@ -47,7 +47,7 @@ if __name__ == "__main__":

+  			rpms.append(rpm_obj)

+  

+  		if rpms == []:

+ -			print "List of rpms empty\n"

+ +			print("List of rpms empty\n")

+  			continue

+  

+  		data = {

+ @@ -59,26 +59,26 @@ if __name__ == "__main__":

+  			}

+  		}

+  

+ -		print data

+ +		print(data)

+  

+  		try:

+ -			#print "Setting:"

+ +			#print("Setting:")

+  			if not act.setData(data):

+ -				print "setData Error: %s\n" % pkg

+ +				print("setData Error: %s\n" % pkg)

+  	

+ -			#print "Executing:"

+ +			#print("Executing:")

+  			if not act.execute():

+ -				print "execute Error: %s\n" % pkg

+ +				print("execute Error: %s\n" % pkg)

+  		except:

+  			exc_info = sys.exc_info()

+  			traceback.print_exception(*exc_info)

+  			del exc_info

+  

+ -		print ""

+ +		print("")

+  	

+ -		#print "Getting:"

+ +		#print("Getting:")

+  		#act.getData()

+ -		#print json.dumps(act.getData())

+ +		#print(json.dumps(act.getData()))

+  		#break

+  # for each build get a list of devel subpackages (make asumption: pkg-devel.noarch.rpm)

+  #rpms = session.getLatestRPMS("rawhide", package="etcd")

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testdriver.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testdriver.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testdriver.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testdriver.py	2019-03-01 17:35:11.443202597 +0100

+ @@ -15,4 +15,4 @@ if __name__ == "__main__":

+  

+  	driver = EtcdFactory().build(artefacts.ARTEFACT_GOLANG_PROJECT_INFO_FEDORA)

+  	driver.store(data)

+ -	#print driver.retrieve(data)

+ +	#print(driver.retrieve(data))

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testff.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testff.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testff.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testff.py	2019-03-01 18:38:05.297174286 +0100

+ @@ -13,4 +13,4 @@ data = {

+  }

+  

+  

+ -print json.dumps(f.call(data))

+ +print(json.dumps(f.call(data)))

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testplugin.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testplugin.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testplugin.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testplugin.py	2019-03-01 18:38:05.306174273 +0100

+ @@ -19,21 +19,21 @@ def runRepositoryDataExtractor():

+  

+  	extractor.execute()

+  	extractor.getData()

+ -	#print json.dumps(act.getData())

+ +	#print(json.dumps(act.getData()))

+  

+  def runDistributionPackageBuildsExtractor():

+  	extractor = DistributionPackageBuildsExtractor()

+ -	print extractor.setData({

+ +	print((extractor.setData({

+  		#"package": "golang-bitbucket-ww-goautoneg",

+  		"package": "etcd",

+  		"product": "Fedora",

+  		"distribution": "f24",

+  		"start_timestamp": 1400131190,

+  		"end_timestamp": 1460131190

+ -	})

+ +	})))

+  

+ -	print extractor.execute()

+ -	print json.dumps(extractor.getData())

+ +	print(extractor.execute())

+ +	print(json.dumps(extractor.getData()))

+  

+  if __name__ == "__main__":

+  

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/test.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/test.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/test.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/test.py	2019-03-01 18:38:05.332174235 +0100

+ @@ -101,11 +101,11 @@ data = {

+  	"exported_api_2": exported_api2

+  }

+  

+ -#print json.dumps(exported_api2)

+ +#print(json.dumps(exported_api2))

+  #exit(1)

+  

+  ff = FunctionFactory()

+  data = ff.bake("goapidiff").call(data)

+  ff.bake("etcdstoragewriter").call(data)

+  

+ -print(json.dumps(data))

+ +print(json.dumps(data))

+ diff -up infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testsnapshot.py.bak infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testsnapshot.py

+ --- infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testsnapshot.py.bak	2018-04-01 15:45:07.000000000 +0200

+ +++ infra-8bf8ce89490dcd0a44bfa9b09a24fd454c20f6b9/testsnapshot.py	2019-03-01 18:38:05.361174193 +0100

+ @@ -32,10 +32,10 @@ def test_reconstructor():

+  	snapshot = SnapshotReconstructor().reconstruct(repository, commit, ipprefix, mains = [], tests=True).snapshot()

+  

+  

+ -	print ""

+ -	print json.dumps(snapshot.Godeps())

+ -	print ""

+ -	print snapshot.GLOGFILE()

+ +	print("")

+ +	print(json.dumps(snapshot.Godeps()))

+ +	print("")

+ +	print(snapshot.GLOGFILE())

+  

+  if __name__ == "__main__":

+  

+ @@ -47,7 +47,7 @@ if __name__ == "__main__":

+  	s2 = DistributionSnapshot().load("/home/jchaloup/Projects/gofed/infra/snapshot2.json")

+  

+  	data = s2.compare(s1)

+ -	print data["new_rpms"]

+ +	print(data["new_rpms"])

+  

+  	exit(1)

+  	snapshot = DistributionSnapshot("rawhide", "1.5")

+ @@ -60,11 +60,11 @@ if __name__ == "__main__":

+  		try:

+  			data = kojiclient.getLatestRPMS("rawhide", package)

+  		except KeyError as e:

+ -			print e

+ +			print(e)

+  			continue

+  		snapshot.setRpms(package, data["rpms"])

+  

+ -	print json.dumps(snapshot.json())

+ +	print(json.dumps(snapshot.json()))

+  

+  	exit(1)

+  

+ @@ -88,7 +88,7 @@ if __name__ == "__main__":

+  

+  	snapshot = SnapshotReconstructor().reconstruct(repository, commit, ipprefix, mains = ["main.go", "etcdctl/main.go"], tests=True).snapshot()

+  

+ -	print ""

+ -	print json.dumps(snapshot.Godeps())

+ -	print ""

+ -	print snapshot.GLOGFILE()

+ +	print("")

+ +	print(json.dumps(snapshot.Godeps()))

+ +	print("")

+ +	print(snapshot.GLOGFILE())

@@ -0,0 +1,30 @@ 

+ diff -up resources-7e414c78930a81167dc2cd4d3e9adb79eeed38a6/gofedresources/retriever.py.bak resources-7e414c78930a81167dc2cd4d3e9adb79eeed38a6/gofedresources/retriever.py

+ --- resources-7e414c78930a81167dc2cd4d3e9adb79eeed38a6/gofedresources/retriever.py.bak	2016-10-04 08:04:48.000000000 +0200

+ +++ resources-7e414c78930a81167dc2cd4d3e9adb79eeed38a6/gofedresources/retriever.py	2019-03-01 18:49:01.439219234 +0100

+ @@ -1,4 +1,4 @@

+ -import urllib2

+ +import urllib.request, urllib.error, urllib.parse

+  import tempfile

+  from .exceptions import ResourceUnableToRetrieveError

+  

+ @@ -11,15 +11,15 @@ class Retriever(object):

+  		# TODO(jchaloup): catch exceptions: urllib2.URLError, urllib2.HTTPError

+  		#	raise ResourceNotRetrieved instead?

+  		try:

+ -			response = urllib2.urlopen(resource_url)

+ -		except urllib2.URLError as err:

+ +			response = urllib.request.urlopen(resource_url)

+ +		except urllib.error.URLError as err:

+  			# can a user do something about it?

+  			msg = "Unable to retrieve resource, url = %s, err = %s" % (resource_url, err)

+ -			raise urllib2.URLError(msg)

+ -		except urllib2.HTTPError as err:

+ +			raise urllib.error.URLError(msg)

+ +		except urllib.error.HTTPError as err:

+  			# can a user do something about it?

+  			msg = "Unable to retrieve resource, url = %s, err = %s" % (resource_url, err)

+ -			raise urllib2.HTTPError(msg)

+ +			raise urllib.error.HTTPError(msg)

+  

+  		try:

+  			with tempfile.NamedTemporaryFile(delete=False) as f:

file modified
+3 -3
@@ -1,5 +1,5 @@ 

  SHA512 (cmdsignature-3320757.tar.gz) = d7d00665861e42d1c9e8f91e466c99a0feaab312ce17492846730aeff842a7172de857cb8f9ac926d150dc4b17dabf14d4a552b1d537e45d894adccbb91bd299

- SHA512 (gofedlib-c2e5b00.tar.gz) = f166d5f2b85904b4e6c40d72c9ba574760ec3d61dc2180a1e93fd556b1f1ec829456c9c31a9b6db4a969a7499dc409c48fae3c48cad9dea5feb75b633a70ef59

- SHA512 (infra-6bff7ae.tar.gz) = 6b99f2b6c45b1d5d5267f9eb906037ad7da2ef69425aadf252cc0a52f5127e8d81dd2f7db535589d82bd7d7fad0efe833a244b1f8197466d394d1cf55f924869

+ SHA512 (gofed-8f62d8d.tar.gz) = 75d987e0f03b786a9a7932eeddd5467ce45151675e7cc84b08ef7ccc570fbc68764f675d14624dcf8c6657b43a5600c27f1d1da7178853bb6c3e2b32aa267c13

+ SHA512 (gofedlib-0674c24.tar.gz) = 89a1bdbdf536cda3545685e1a220f9274a09c8eddb3b695fee7429fdc154d322e5801991f47868e7c08c13e045f2f399add2e1f4e3f5e2a31237d7cdc4590c68

+ SHA512 (infra-8bf8ce8.tar.gz) = 3950a8bd3c19b361491284a890291c0fdf94c62aef7994840df363daab611a2cf304f65bed67500bf146ee671d3914789be01de8e2ef805d793fd7af3d4864dd

  SHA512 (resources-7e414c7.tar.gz) = 8f3c2faa5536c0d9fc2912b4b9f974026c05c8677234bf31af0470e651d126795a1bc09c806971bfff1d1d39dae2dc6c75404035925cde0d4c434a88f19c83fe

- SHA512 (gofed-48d80fe.tar.gz) = 7190ea4027a7e1735268492a049a006293ba431b028ce20dcaeb4ab5cb75df740fe62b0a008f933644401c752cf6de35b140f18c995dd2b9277ebe432ca17c9b