Skip to content

Commit

Permalink
[#2071] Replace platform.linux_distribution()
Browse files Browse the repository at this point in the history
  • Loading branch information
JustinKyleJames authored and alanking committed Jun 11, 2022
1 parent 76906b8 commit 9c05969
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 2 additions & 5 deletions packaging/resource_suite_s3_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import string
import subprocess
import urllib3
import distro

from .resource_suite_s3_nocache import Test_S3_NoCache_Base

Expand Down Expand Up @@ -57,11 +58,6 @@ def __init__(self, *args, **kwargs):
super(Test_S3_Cache_Base, self).__init__(*args, **kwargs)

def setUp(self):
# skip ssl tests on ub12
distro_str = ''.join(platform.linux_distribution()[:2]).replace(' ','').replace('.', '')
if self._testMethodName.startswith('test_ssl') and distro_str.lower().startswith('ubuntu12'):
self.skipTest("skipping ssl tests on ubuntu 12")

# set up aws configuration
self.read_aws_keys()

Expand Down Expand Up @@ -97,6 +93,7 @@ def setUp(self):
if hasattr(self, 'static_bucket_name'):
self.s3bucketname = self.static_bucket_name
else:
distro_str = '{}-{}'.format(distro.id(), distro.version()).replace(' ', '').replace('.', '')
self.s3bucketname = 'irods-ci-' + distro_str + datetime.datetime.utcnow().strftime('-%Y-%m-%d%H-%M-%S-%f-')
self.s3bucketname += ''.join(random.choice(string.ascii_letters) for i in range(10))
self.s3bucketname = self.s3bucketname[:63].lower() # bucket names can be no more than 63 characters long
Expand Down
3 changes: 2 additions & 1 deletion packaging/resource_suite_s3_nocache.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import io
import psutil
import subprocess
import distro

from .. import paths
from ..configuration import IrodsConfig
Expand Down Expand Up @@ -115,7 +116,7 @@ def setUp(self):
if hasattr(self, 'static_bucket_name'):
self.s3bucketname = self.static_bucket_name
else:
distro_str = ''.join(platform.linux_distribution()[:2]).replace(' ','').replace('.', '')
distro_str = '{}-{}'.format(distro.id(), distro.version()).replace(' ', '').replace('.', '')
self.s3bucketname = 'irods-ci-' + distro_str + datetime.datetime.utcnow().strftime('-%Y-%m-%d%H-%M-%S-%f-')
self.s3bucketname += ''.join(random.choice(string.ascii_letters) for i in range(10))
self.s3bucketname = self.s3bucketname[:63].lower() # bucket names can be no more than 63 characters long
Expand Down

0 comments on commit 9c05969

Please sign in to comment.