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

[AMBARI-23531]. Debian9: Atlas client installation failed due to unsupported OS family error (amagyar) #959

Merged
merged 2 commits into from Apr 11, 2018

Conversation

zeroflag
Copy link
Contributor

What changes were proposed in this pull request?

Package installation on debian failed "Not able to create Repository Manager object for unsupported OS family" error.

How was this patch tested?

Installed HDP on debian.

@zeroflag zeroflag self-assigned this Apr 10, 2018
@zeroflag zeroflag requested review from a user, hapylestat and rlevas April 10, 2018 19:12
@asfgit
Copy link

asfgit commented Apr 11, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/1751/
Test FAILed.
Test FAILured.

@@ -61,6 +61,7 @@ def get_new_instance(cls, os_family=None):

construct_rules = {
OSConst.UBUNTU_FAMILY: AptManager,
OSConst.DEBIAN_FAMILY: AptManager,
Copy link
Contributor

Choose a reason for hiding this comment

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

it's strange, i have supposed that DEBIAN is a child of the UBUNTU family, as it extends it. Problem will repeat with *-PPC variation of the system families. Could we extend OsFamily to return the root os family, not the extended leaf and use it in the constructor?

Copy link
Contributor Author

@zeroflag zeroflag Apr 11, 2018

Choose a reason for hiding this comment

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

@hapylestat, I don't fully understand what you suggest.

The problem is that OSConst.UBUNTU_FAMILY is a simple string so it won't match to OSConst.DEBIAN_FAMILY.

>>> type(os_check.OSConst.OS_UBUNTU)
<type 'str'>

However this one works correctly and returns True on Debian.

>>> os_check.OSCheck.is_ubuntu_family()
True

So instead of the map lookup we could modify it to something like this:

  @classmethod
  def get_new_instance(cls, os_family=None):
    """
    Construct new instance of Repository Manager object. Call is not thread-safe

    :param os_family:  os family string; best used in combination with `OSCheck.get_os_family()`
    :type os_family str
    :rtype GenericManager
    """
    if not os_family:
      os_family = OSCheck.get_os_family()

    if OSCheck.is_in_family(os_family, OSConst.UBUNTU_FAMILY):
      return AptManager()
    if OSCheck.is_in_family(os_family, OSConst.SUSE_FAMILY):
      return ZypperManager()
    if OSCheck.is_in_family(os_family, OSConst.REDHAT_FAMILY):
      return YumManager()
    if OSCheck.is_in_family(os_family, OSConst.WINSRV_FAMILY):
      return ChocoManager()

    raise RuntimeError("Not able to create Repository Manager object for unsupported OS family {0}".format(os_family))```

@asfgit
Copy link

asfgit commented Apr 11, 2018

Refer to this link for build results (access rights to CI server needed):
https://builds.apache.org/job/Ambari-Github-PullRequest-Builder/1765/
Test PASSed.

@zeroflag zeroflag merged commit 5db1048 into apache:trunk Apr 11, 2018
@zeroflag zeroflag deleted the AMBARI-23531-trunk branch April 11, 2018 09:29
vishalsuvagia pushed a commit to vishalsuvagia/ambari that referenced this pull request Apr 11, 2018
* origin/trunk:
  [AMBARI-23531]. Debian9: Atlas client installation failed due to unsupported OS family error (amagyar) (apache#959)
  [AMBARI-23486] Move SSO-related properties from ambari.properties into the Ambari DB
  [AMBARI-23494] Incorrect servicerpc address configs being generated by NN Federation wizard. Second patch. (akovalenko) (apache#961)
  AMBARI-23498. Default shared edits location should be preserved. Fixing issues after resolving merge confilcts. (akovalenko)
  AMBARI-23459. ServiceAdvisor KeyError during kerberization of OneFS (amagyar)
  AMBARI-23386 HSI ADDENDUM Jdbc URL should handle HA mode (mgergely)
  [AMBARI-23431] Removing hostId condition in order to process AMBARI identities even if there was an agent installed on the server's host (apache#897)
  [AMBARI-23487] Cannot tell which services are in maintenance mode. (apache#909)
  [AMBARI-23483] Hosts Breadcrumb doesn't persist filters.
  [AMBARI-23481] Selected Hosts dropdown is disabled after navigating away and coming back to hosts page.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants