diff options
author | Danilo Segan <danilo@canonical.com> | 2012-08-22 20:29:41 +0200 |
---|---|---|
committer | Danilo Segan <danilo@canonical.com> | 2012-08-22 20:29:41 +0200 |
commit | 3556fc0aedf9ff695fcac8a9e6c9a289a59def52 (patch) | |
tree | 91d99903bdf143f2a0e732365910190b9714b50d /scripts | |
parent | 67dd3bd71debc60a8007f28e756317f8fc13250a (diff) |
Implement basic sanitize_file.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/publish_to_snapshots.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/publish_to_snapshots.py b/scripts/publish_to_snapshots.py index f62a5e0..21b25bb 100755 --- a/scripts/publish_to_snapshots.py +++ b/scripts/publish_to_snapshots.py @@ -63,7 +63,10 @@ class SnapshotsPublisher(object): @classmethod def sanitize_file(cls, file_path): """This truncates the file and fills it with its own filename.""" - pass + assert not cls.is_accepted_for_staging(file_path) + protected_file = open(file_path, "w") + protected_file.truncate() + protected_file.close() def validate_args(self, args): # Validate that all the required information |