Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This patch will instaall targetcli-fb package to bionic version. #1445

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

prudmirya
Copy link
Contributor

This patch will instaall targetcli-fb package to bionic version. Existing tagetcli package name changed to targetcli-fb in bionic
Signed-off-by: prudhvi [email protected]

if distro.detect().version == '18' and distro.detect().name == 'Ubuntu':
iscsi_package = ["targetcli-fb"]
else:
iscsi_package = ["targetcli"]
Copy link
Member

Choose a reason for hiding this comment

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

have try... block,
to handle it generic for all distros, future some other distro versions might also have this naming.
...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if i try to install targetcli on 18.04 version it will not error out because wait_for_login(), and some times guest got crashed.

Copy link
Member

Choose a reason for hiding this comment

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

The better way for this would to implement a API in utils_package that would give you the package name by querying irrespective of distro, like yum whatprovides targetcli in this case for RHEL based package manager and similar in Ubuntu

@@ -843,7 +843,10 @@ def create_iSCSI(params, root_dir=data_dir.get_tmp_dir()):
raise exceptions.TestError("Failed to install iscsi initiator"
" packages")
# Install linux iscsi target software targetcli
iscsi_package = ["targetcli"]
if distro.detect().version == '18' and distro.detect().name == 'Ubuntu':
Copy link
Member

@balamuruhans balamuruhans Mar 30, 2018

Choose a reason for hiding this comment

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

This would break in future Ubuntu releases,

iscsi_package = ["targetcli"]
if distro.detect().name == 'Ubuntu' and int(distro.detect().version) >= 18:
    iscsi_package = ["targetcli-fb"]

if distro.detect().version == '18' and distro.detect().name == 'Ubuntu':
iscsi_package = ["targetcli-fb"]
else:
iscsi_package = ["targetcli"]
Copy link
Member

Choose a reason for hiding this comment

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

The better way for this would to implement a API in utils_package that would give you the package name by querying irrespective of distro, like yum whatprovides targetcli in this case for RHEL based package manager and similar in Ubuntu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants