awsumepy.py 文件源码

python
阅读 19 收藏 0 点赞 0 评论 0

项目:awsume 作者: trek10inc 项目源码 文件源码
def remove_all_auto_profiles(filePath):
    """
    remove all profiles from the credentials file that contain 'auto-refresh-'
    """
    log.info('Removing all autoAwsume profiles')

    #remove the auto-awsume profiles from the credentials file
    autoAwsumeProfileParser = ConfigParser.ConfigParser()
    autoAwsumeProfileParser.read(filePath)
    #scan all profiles to find auto-refresh profiles
    for profile in autoAwsumeProfileParser._sections:
        if 'auto-refresh-' in profile:
            log.debug('Removing profile ' + profile + ' from credentials file')
            autoAwsumeProfileParser.remove_section(profile)
    #save changes
    autoAwsumeProfileParser.write(open(filePath, 'w'))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号