Commit graph

53 commits

Author SHA1 Message Date
Sebastien Awwad
d98152bc9d
Remove some unnecessary try-reraise constructions; thanks, pylint!
These changes simplify logic, removing some try/except structures
that were unnecessary and potentially confusing, and get us back
to passing pylint's test.

pylint 2.0.0 adds try-except-raise tests, to catch immediate
re-raising after catching an exception, outside of some special
cases. See this GitHub comment for more info:
https://github.com/theupdateframework/tuf/pull/770#issuecomment-412993992

Signed-off-by: Sebastien Awwad <sebastien.awwad@gmail.com>
2018-08-21 14:59:29 -04:00
Vladimir Diaz
751079fa82
Fix unit test failures in test_developer_tool.py
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-04-27 11:41:11 -04:00
Vladimir Diaz
fe5d335555
Modify modules to remove/expect no leading path separators
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-04-06 13:16:41 -04:00
Vladimir Diaz
8f65fa4154
Rename license files in modules
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2018-02-05 11:31:19 -05:00
Vladimir Diaz
3894bc4e31
Add copyright and license info to module files
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-11-30 13:23:38 -05:00
Vladimir Diaz
21a8dcacb9
Resolve remaining Pylint warning in developer_tool.py
* Fix parameter list in overridden add_verification_key so that is matches ancestor.

Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-11-27 14:39:23 -05:00
Vladimir Diaz
6f7ba76b9b
Resolve many Pylint warnings for developer_tool
* Remove unused import statements
* Add wrapper for interface functions
* Remove unused variables
* Fix incorrect number of arguments to modified function
* Convert non-public attributes

Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-11-27 11:37:46 -05:00
Vladimir Diaz
5a71ba7d68
Resolve unused and junk variables in developer_tool.py
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-11-20 14:10:28 -05:00
Vladimir Diaz
bb8729487d
Resolve Pylint's identified [E]rrors in the codebase
Signed-off-by: Vladimir Diaz <vladimir.v.diaz@gmail.com>
2017-11-15 16:34:34 -05:00
Vladimir Diaz
a602d449f3
Remove compression from developer_tool.py 2017-08-25 16:59:16 -04:00
Vladimir Diaz
bcf43e63a2
Edit metadata and code for developer_tool.py 2017-08-23 12:47:20 -04:00
Vladimir Diaz
f0bf2bc65a Support multiple repositories in developer_tool.py 2017-02-08 16:45:23 -05:00
Vladimir Diaz
4abe845daf Fix import statements in various test modules 2017-01-11 17:05:46 -05:00
Vladimir Diaz
1e0cde9279 Ensure developer_tool.py imports the correct tuf.formats module 2016-11-09 14:53:07 -05:00
Artiom Baloian
299ff68edd Now crypto related files are in ssl_crypto and ssl_commons 2016-11-02 17:44:32 -04:00
Artiom Baloian
b0156944bb Moved util.py, now it is common 2016-11-02 09:49:37 -04:00
Artiom Baloian
b793c81739 Added simple_settings, now it is a requirement of TuF.
Rename conf.py into the settings.py an changed import call.
2016-11-01 15:38:40 -04:00
Artiom Baloian
b07d9a5d0f Move some part of tufformats into the common formats 2016-10-31 19:04:14 -04:00
Artiom Baloian
8247a02737 Moved TuF exceptions and schem into the ssl_commons 2016-10-31 11:58:05 -04:00
Artiom Baloian
7098cdbc3a Move _vendor dir and split formats into the formats and tufformats 2016-10-28 18:37:28 -04:00
Vladimir Diaz
f6ec7fb578 Remove _delete_obsolete_metadata() from developer_tool.py and update MANIFEST.in to list scripts. 2016-08-25 14:34:36 -04:00
Vladimir Diaz
5c7333b062 Fix unit tests for developer_tool.py 2016-07-01 12:52:04 -04:00
Vladimir Diaz
e27371113f Update developer tool 2016-04-14 16:53:48 -04:00
Vladimir Diaz
18844f6453 Initial refactor of developer tool 2016-04-05 20:23:37 -04:00
Vladimir Diaz
4cb851ca0a Fix remaining issues with unit tests after implementing version numbers in snapshot.json 2015-10-27 16:11:11 -04:00
Vladimir Diaz
1c8f41b0c0 Update import statements of unvendored dependencies 2015-06-02 08:29:22 -04:00
Vladimir Diaz
1985c450c9 Merge custom info changes, logger messages, and minor edits. 2014-07-02 11:10:50 -04:00
vladdd
2f520dd140 Review and update pull request #188. 2014-06-30 14:04:01 -04:00
Santiago Torres
26eb5b7e35 Added relative filepath support and increased coverage
After seeing the coveralls report I realized the projects were not
relocatable. While this might be convenient for some uses, moving a
project from one place to another might not be optimal. This has been
changed now.

The only place where absolute filepaths are handled now is with flat
project layouts. However, it is possible to overwrite this filepath if
the targets folder is to be changed.
2014-06-21 19:07:34 -04:00
Santiago Torres
91579e9c15 Fixed developer tools to match the new repository_lib file
As of the current version, some functions that were provided by the
repository_tool have been moved to the repository_lib module. This
commit fixes those conflicts
2014-06-20 19:38:13 -04:00
Santiago Torres
f50955ee79 Added import statements for constant definitions
Metadata and targets directory names were redeclared in a local
variable. They are now imported from the repository_tool.

I also removed an unnecessary declaration for the targets.json file
expiration since it didn't have anything to do with the developer tools
2014-04-25 23:55:00 -04:00
Santiago Torres
36c3f2c1d2 Added schema check and project.cfg schema
There is a new entry in tuf.formats.py that represents the layout of the
project.cfg file. This new schema will be used to check for sanity upon
loading the .cfg file in the load_project function
2014-04-24 18:51:35 -04:00
Santiago Torres
559f8d796d Updated config.cfg file structure
The public key for the whole project used to be stored in a non-standard
way (this means, not as a keydict schema). I migrated the data structure
to a valid keydict schema with the aim of improving code-consistency in
the developer tools.

This will also make schema checks easier
2014-04-24 18:49:34 -04:00
Santiago Torres
7153c34eed Added roledb and keydb clear statements upon load
To avoid conflicts in the load_project function, we clear the roledb and
the keydb modules. This ensures that there are no repeated entries from
previous runs.
2014-04-24 18:48:20 -04:00
Santiago Torres
c29b362df7 Updated function import for get_metadata_fileinfo
get_metadata_fileinfo was originally called get_metadata_file_info. This
was fixed to match the new repository tool.
2014-04-22 14:24:13 -04:00
Santiago Torres
30b97a8a7a Changed the logger tag
tuf.devtools -> tuf.developer_tool
2014-04-04 14:08:17 -04:00
Santiago Torres
1a353c08d4 Added support for project names.
Project name is now an argument of the project constructor and the
create_new project function.

The project_name field defines the rolename to add to the roledb, the
filename to create and adds a new field to the project.cfg file.
2014-04-03 14:00:33 -04:00
Santiago Torres
a16dd6095e file open is now done with the "with" statement
The with statement is a more "native" way to do the same thing, it is
done that way not.
2014-04-02 23:12:38 -04:00
Santiago Torres
99b2ad40a7 release_signable was renamed to project_signable
release_signable didn't make too much sense in such context and was
renamed to a more accurate and descriptive variable name.
2014-04-02 23:11:29 -04:00
Santiago Torres
9cb1181bc3 Updated constant definitions, they are imported from tuf.developer_tool
This makes it easier to propagate design changes through the two
different tools.

A tuf.constants module would be a good addition to this.
2014-04-02 23:09:35 -04:00
Santiago Torres
561e85959b Removed a local definition of the prompt and get_password methods
The local _prompt and _get_password methods were deleted in order to use
the version contained in the tuf.repository_tools. The main motivation
of this change is to provide code reutilization
2014-04-01 23:43:24 -04:00
Santiago Torres
1a9f9eb0be updated method descriptions in the comment blocks 2014-04-01 14:53:08 -04:00
Santiago Torres
4a35d53d2f Added a comment block describing the project.cfg file 2014-04-01 14:52:23 -04:00
Santiago Torres
6337f59a2e Fixed whitespace errors between methods. 2014-04-01 14:48:06 -04:00
Santiago Torres
036ac692a6 fixed references to the repository tool in comments. 2014-04-01 14:45:56 -04:00
Santiago Torres
ae3b3a01d6 Removed commented lines and fixed minor comments
Some unused methods were commented for testing, they shouldn't appear in
upstream
2014-04-01 13:49:41 -04:00
Santiago Torres
5495331d81 Updaated the module name in the comments, fixed comment references 2014-04-01 13:40:40 -04:00
Santiago Torres
ff9fdd833b The _check_if_partial_loaded method was renamed
The repository tool now provides a method called
"_metadata_is_partially_loaded" to provide the same functionality, the
return type changed so the flow of this module had to adapt to the new
function:

_check_if_partial_loaded() -> updated the roleinfo data as an effect

_metadata_is_partially_loaded -> returns a boolean and forces us to
update the roleinfo data.
2014-04-01 12:51:33 -04:00
Santiago Torres
0c6918b702 Updated the load project method to include the Targets inherittance
The load_project contained statements that called the previously
included "targets" instance, since we now inherit Targets, we don't
require them, the statements were updated the following way:

self._targets

to a plain:

self
2014-03-31 20:44:53 -04:00
Santiago Torres
cace6820de Added soft wrappers for the add_verification_key method
The add verification key method now prohibits the ability to have more
than one key in the Project role, however, delegations do support
having more.

This is the suggested behavior as of this version, removing these two
wapper functions would prevent to have this limitation but would require
the extension of the write_project_configuration function
2014-03-31 19:10:02 -04:00