Changeset 1960


Ignore:
Timestamp:
Jun 17, 2016, 2:31:21 PM (3 years ago)
Author:
kbut
Message:

add new function to list available mirrors

Location:
lliurex-mirror/trunk/fuentes
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • lliurex-mirror/trunk/fuentes/lliurex-mirror-cli/usr/bin/lliurexmirror

    r1934 r1960  
    7676                sys.exit( 0 if result['status'] else 1 )
    7777
     78        def getAvailableDistros(self):
     79                result = self.client.get_available_mirrors(self,credentials,"MirrorManager")
     80                print str(result['msg'])
     81                sys.exit( 0 if result['status'] else 1 )
     82
    7883def usage():
    7984        puts("Usage")
     
    9499                        puts("enablewebserverforpath")
    95100                        puts("stopwebserver")
     101                        puts("getavailabledistros")
    96102        sys.exit(1)
    97103
     
    180186        elif action == "stopwebserver":
    181187                lliurexmirror.stopWebserver()
     188        elif action == "getavailabledistros":
     189                lliurexmirror.getAvailableDistros()
    182190
    183191
  • lliurex-mirror/trunk/fuentes/n4d-lliurex-mirror.install/etc/n4d/conf.d/MirrorManager

    r1955 r1960  
    88is_alive=adm,admins
    99set_mirror_info=adm,admins
    10 get_mirror_architecture=adm,admins
     10get_mirror_architecture=anonymous,*
    1111set_mirror_architecture=adm,admins
    12 get_mirror_orig=adm,admins
     12get_mirror_orig=anonymous,*
    1313set_mirror_orig=adm,admins
    14 get_percentage=adm,admins
     14get_percentage=anonymous,*
    1515build_debmirror_config=adm,admins
    1616enable_webserver_into_folder=adm,admins
    1717stop_webserver=adm,admins
    1818set_checksum_validation=adm,admins
    19 get_checksum_validation=adm,admins
     19get_checksum_validation=anonymous,*
     20get_available_mirrors=anonymous,*
  • lliurex-mirror/trunk/fuentes/n4d-lliurex-mirror.install/usr/share/n4d/python-plugins/MirrorManager.py

    r1958 r1960  
    372372        #get_checksum_validation
    373373       
     374        def get_available_mirrors(self):
     375                versions = os.listdir(self.configpath)
     376                versions = [ version.replace('.json','') for version in versions if version.endswith('.json')]
     377                return {'status':True,'msg':versions}
Note: See TracChangeset for help on using the changeset viewer.