Giter Club home page Giter Club logo

Comments (6)

natewalck avatar natewalck commented on August 24, 2024

From [email protected] on July 21, 2010 14:31:38

Please tag feature requests as "Type-Enhancement", not "Type-Defect".

Good suggestion for supporting multiple servers.

Yes, separate URLS are supported:

    ManifestURL
    CatalogURL
    PackageURL

Status: Accepted
Labels: -Type-Defect Type-Enhancement

from munki.

natewalck avatar natewalck commented on August 24, 2024

From [email protected] on July 21, 2010 14:36:17

Just came to my mind:
What if munki gets an connection error while downloading packages, could it automatically try to switch to another repo for that package?
It may be need to know if it has permissions to do so, using ManagedInstalls.plist AutoSwitchRepoOnFlyAllowed true|false.
Just a thought.

from munki.

chrisgrande avatar chrisgrande commented on August 24, 2024

I was looking at possibly implementing this type of functionality, it seemed the lowest point to add it would be within prefs.pref where if the preference requested is one of the six URL preferences, check if the preference is an array and if so return the first one that is reachable, along the lines of:

 if pref_name in ['SoftwareRepoURL',
                     'ClientResourceURL',
                     'ManifestURL',
                     'PackageURL',
                     'CatalogURL',
                     'SoftwareUpdateServerURL'] and isinstance(pref_value, NSArray):
        for pref_value_url in pref_value:
            result = urllib.request.urlopen(pref_value_url).getcode()
            if result == 200:
                return pref_value_url
            else:
                pass
    else:
        if isinstance(pref_value, NSDate):
            # convert NSDate/CFDates to strings
            pref_value = str(pref_value)
        return pref_value

I wanted to the use fetch.check_server that's already built into munkilib but can't import it into prefs due to it causing some inception, so I settled on urllib.request. Thoughts?

from munki.

gregneagle avatar gregneagle commented on August 24, 2024

In Python 3.7.4: AttributeError: "module 'urllib' has no attribute 'request'"

I don't think this is something I want to be on the hook to support. Could this not be done in a Munki preflight? IOW, figure out what's accessible, then write the currently accessible URLs to Munki's prefs.

from munki.

chrisgrande avatar chrisgrande commented on August 24, 2024

Need to import it as urllib.request.

Understandable on maintaining. I really wanted to do it via DNS, but not possible in my environment.

I had not thought of a preflight script. The functionality in munkilib can then be used to test the URLs without the import hoops or trying to reinvent the wheel. The arrays of URLs can then be stored in the already MDM maintained ManagedInstalls prefs via its own set of keys.

I had only thought about baking it in since I had found this outstanding issue during my research.

from munki.

natewalck avatar natewalck commented on August 24, 2024

I think #966 could cover this functionality. It would allow you to add urls to the pkginfo and then do the logic you need inside middleware. this would keep the core munki logic clean and make it more flexible (could do latency tests on each server, etc before passing the URL back).

from munki.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.