summaryrefslogtreecommitdiff
path: root/tools/mock-meta.py
AgeCommit message (Collapse)Author
2020-08-25tox: bump the pylint version to 2.6.0 in the default run (#544)Paride Legovini
Changes: tox: bump the pylint version to 2.6.0 in the default run Fix pylint 2.6.0 W0707 warnings (raise-missing-from)
2020-03-24tools: use python3 (#274)Ryan Harper
* tools: use python3 Switch tools/ to use python3 instead of python. At minimum this fixes building deb on python3 only releases like Focal. Applied via shell commands: $ grep 'usr/bin/.*python' tools/* 2>/dev/null | \ grep -v python3 | awk -F':' '{print $1}' | \ xargs -i sed -i -e '0,/python/s/python/python3/' {} * Use /usr/bin/env python3 to be virtualenv friendly
2017-12-07pylint: Update pylint to 1.7.1, run on tests/ and tools and fix complaints.Ryan Harper
The motivation for this is that a.) 1.7.1 runs with python 3.6 (bionic) b.) we want to run pylint on tests/ and tools for the same reasons that we want to run it on cloudinit/ The changes are described below. - Update tox.ini to invoke pylint v1.7.1. - Modify .pylintrc generated-members ignore mocked object members (m_.*) - Replace "dangerous" params defaulting to {} - Fix up cloud_tests use of platforms - Cast some instance objects to with dict() - Handle python2.7 vs 3+ ConfigParser use of readfp (deprecated) - Update use of assertEqual(<boolean>, value) to assert<Boolean>(value) - replace depricated assertRegexp -> assertRegex - Remove useless test-class calls to super class - Assign class property accessors a result and use it - Fix missing class member in CepkoResultTests - Fix Cheetah test import
2017-07-17tools: Fix exception handling.Joonas Kylmälä
We should be expecting IndexError instead of KeyError because we are using a list (key_ids) and not a dictionary. Also, thanks to Emmanuel Kasper for pointing out the wrong response code. LP: #1701527
2017-05-23flake8: move the pinned version of flake8 up to 3.3.0Scott Moser
This just moves flake8 and related tools up to newer versions and fixes the complaints associated with that. We added to the list of flake8 ignores: H102: do not put vim info in source files H304: no relative imports Also updates and pins the following in the flake8 environment: pep8: 1.7.0 => drop (although hacking still pulls it in). pyflakes 1.1.0 => 1.5.0 hacking 0.10.2 => 0.13.0 flake8 2.5.4 => 3.3.0 pycodestyle none => 2.3.1
2017-04-21pylint: fix all logging warningsJoshua Powers
This will change all instances of LOG.warn to LOG.warning as warn is now a deprecated method. It will also make sure any logging uses lazy logging by passing string format arguments as function parameters.
2017-02-05code-style: make master pass pycodestyle (2.3.1) cleanly, currently:Joshua Powers
$ pycodestyle cloudinit/ tests/ tools/ tools/make-mime.py:25:5: E722 do not use bare except' tools/mock-meta.py:252:17: E722 do not use bare except' For tools/make-mime.py:25:5: E722 do not use bare except' the use case is when someone runs ./make-mime.py --attach commis instead of ./make-mime.py --attach commissaire.txt:x-commissaire-host The split can cause a ValueError potentially if there is no: For tools/mock-meta.py:262:17: E722 do not use bare except' the use case is a dictionary look up occurs potentially when an unknown key is given: key_name = key_ids[key_id] Do note that version 2.3.0 falsely reported a dozen or so E302 and E306 errors.
2017-01-25tools/mock-meta: support python2 or python3 and ipv6 in both.Scott Moser
Fix mock-meta to work with python2 or python3. Additionally, it will now listen to ipv6 connections, where previously it would only work with ipv4.
2016-12-22LICENSE: Allow dual licensing GPL-3 or Apache 2.0Jon Grimm
This has been a recurring ask and we had initially just made the change to the cloud-init 2.0 codebase. As the current thinking is we'll just continue to enhance the current codebase, its desirable to relicense to match what we'd intended as part of the 2.0 plan here. - put a brief description of license in LICENSE file - put full license versions in LICENSE-GPLv3 and LICENSE-Apache2.0 - simplify the per-file header to reference LICENSE - tox: ignore H102 (Apache License Header check) Add license header to files that ship. Reformat headers, make sure everything has vi: at end of file. Non-shipping files do not need the copyright header, but at the moment tests/ have it.
2016-03-03Update pep8 runner and fix pep8 issuesRyan Harper
2014-08-26further remove evidence of pylint.Scott Moser
This just removes comments '# pylint:' things and other code remnents of pylint.
2012-08-22fix pep8 complaints.Scott Moser
make pep8 now is silent on precise's pep8 ( 0.6.1-2ubuntu2).
2012-08-09stright forward pylint cleanups to tests/ and tools/Scott Moser
2012-07-03Remove the useless function printout.Joshua Harlow
2012-07-03When the hostname is also the ip (thus no hostname) just use 'localhost'Joshua Harlow
2012-07-031. Cleanup of some mock functionalityJoshua Harlow
2. Adding in returning the 'public-keys' to the metadata 'list' response 3. Adding in sending back the running users keys (useful for testing) along with 'brickies' 4. Add in a traverse function that can walk down a dictionary (if possible)
2012-07-031. Update the mock ec2 data with some of the pubkey code from smosers ec2 ↵Joshua Harlow
metadata server. 2. Allow the setting of the ip addr (not just to 0.0.0.0) 3. Add comment as to how to use this for the 169 'magic' addr
2012-07-02Add a check on the filename provided ensuring it actually exists.Joshua Harlow
2012-07-02Update the mock metadata server to return a file (or the default generated ↵Joshua Harlow
content) for the userdata blob.
2012-06-25Add warning when hitting a unknown api.Joshua Harlow
2012-06-20Return a empty json map as default instead of an empty string for unknown fieldsJoshua Harlow
2012-06-19Add a mock ec2 metadata server that can be used for testing withJoshua Harlow