You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by lf...@apache.org on 2022/10/20 13:32:25 UTC
[incubator-datalab] 01/02: fixed conflict
This is an automated email from the ASF dual-hosted git repository.
lfrolov pushed a commit to branch epm-v2.5.2.1
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git
commit d73f4baabaf1ae89b8d07e7e97b000f993b9126f
Author: Oleksandr Polishchuk2 <ol...@epam.com>
AuthorDate: Tue May 10 17:29:55 2022 +0300
fixed conflict
---
.../general/scripts/os/get_list_available_pkgs.py | 27 ++++++++++++++--------
1 file changed, 18 insertions(+), 9 deletions(-)
diff --git a/infrastructure-provisioning/src/general/scripts/os/get_list_available_pkgs.py b/infrastructure-provisioning/src/general/scripts/os/get_list_available_pkgs.py
index 8e33b20bf..86c84128c 100644
--- a/infrastructure-provisioning/src/general/scripts/os/get_list_available_pkgs.py
+++ b/infrastructure-provisioning/src/general/scripts/os/get_list_available_pkgs.py
@@ -60,15 +60,24 @@ def get_available_pip_pkgs(version):
def get_uncategorised_pip_pkgs(all_pkgs_pip2, all_pkgs_pip3):
try:
pip_pkgs = dict()
- client = xmlrpc.client.ServerProxy('https://pypi.python.org/pypi')
- raw_pkgs = client.list_packages()
- all_pkgs_other = []
- for pkg in raw_pkgs:
- if pkg not in all_pkgs_pip2 and pkg not in all_pkgs_pip3:
- all_pkgs_other.append(pkg)
- for pkg in all_pkgs_other:
- pip_pkgs[pkg] = "N/A"
- return pip_pkgs
+ attempts = 0
+ while attempts < 3:
+ try:
+ client = xmlrpc.client.ServerProxy('https://pypi.python.org/pypi')
+ raw_pkgs = client.list_packages()
+ all_pkgs_other = []
+ for pkg in raw_pkgs:
+ if pkg not in all_pkgs_pip2 and pkg not in all_pkgs_pip3:
+ all_pkgs_other.append(pkg)
+ for pkg in all_pkgs_other:
+ pip_pkgs[pkg] = "N/A"
+ return pip_pkgs
+ except:
+ attempts += 1
+ time.sleep(10)
+ if attempt == 3:
+ logging.info("Unable to get uncategorised pip packages")
+ raise Exception
except Exception as err:
print('Error: {0}'.format(err))
sys.exit(1)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org