Changeset 3685


Ignore:
Timestamp:
Feb 21, 2017, 12:55:02 PM (2 years ago)
Author:
mabarracus
Message:

Add n4d is_mirror_available method

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

Legend:

Unmodified
Added
Removed
  • lliurex-mirror/trunk/fuentes/debian/changelog

    r3561 r3685  
     1lliurex-mirror (28.4.4) xenial; urgency=medium
     2
     3  * Add n4d is_mirror_available method
     4
     5 -- M.Angel Juan <m.angel.juan@gmail.com>  Tue, 21 Feb 2017 12:54:17 +0100
     6
    17lliurex-mirror (28.4.3-lliurex2) xenial; urgency=medium
    28
  • lliurex-mirror/trunk/fuentes/n4d-lliurex-mirror.install/etc/n4d/conf.d/MirrorManager

    r2787 r3685  
    3535get_last_log=anonymous,*
    3636update_size_info=anonymous,*
     37is_mirror_available=anonymous,*
  • lliurex-mirror/trunk/fuentes/n4d-lliurex-mirror.install/usr/share/n4d/python-plugins/MirrorManager.py

    r3522 r3685  
    703703                onelinecontent = ''.join(content)
    704704                return {'status':True,'msg':base64.b64encode(onelinecontent)}
    705 
    706 
    707 
     705        #def get_last_log(self):
     706       
     707        def is_mirror_available(self):
     708            import fnmatch
     709           
     710            config=self.get_all_configs()
     711            path=str(config['msg'][self.distro]['MIRROR_PATH'])
     712           
     713            found=False
     714            for root,dirnames,filenames in os.walk(path+'/pool/main/l/lliurex-version-timestamp/'):
     715                for filename in fnmatch.filter(filenames,'lliurex-version-timestamp_*.deb'):
     716                    found=True
     717            if found:
     718                return {'status':True,'msg':'Mirror available'}
     719            else:
     720                return {'status':False,'msg':'Mirror unavailable'}
     721        #def is_mirror_available(self):
     722
     723
Note: See TracChangeset for help on using the changeset viewer.