From 57ed946414a9fe66bf5738ac6b287b56eed334d6 Mon Sep 17 00:00:00 2001 From: Nico Schottelius Date: Fri, 21 Sep 2012 20:25:37 +0200 Subject: [PATCH] Remove __self variable Signed-off-by: Nico Schottelius --- doc/changelog-2.1 | 1 + doc/man/cdist-reference.text.sh | 3 --- lib/cdist/core/code.py | 1 - lib/cdist/core/manifest.py | 1 - lib/cdist/test/code/__init__.py | 2 -- .../code/fixtures/conf/type/__dump_environment/gencode-local | 1 - lib/cdist/test/manifest/__init__.py | 1 - 7 files changed, 1 insertion(+), 9 deletions(-) diff --git a/doc/changelog-2.1 b/doc/changelog-2.1 index 973dae99..6398e7dc 100644 --- a/doc/changelog-2.1 +++ b/doc/changelog-2.1 @@ -5,6 +5,7 @@ Changelog (v2.1 specific) * Exception: No braces means author == Nico Schottelius 2.1.0: + * Core: Removed obsolete variable __self * Removed type __addifnosuchline (replaced by __line) * Removed type __removeline (replaced by __line) * Type __directory: Parameter --parents and --recursive are now boolean diff --git a/doc/man/cdist-reference.text.sh b/doc/man/cdist-reference.text.sh index 3f4f7c98..cf1b852f 100755 --- a/doc/man/cdist-reference.text.sh +++ b/doc/man/cdist-reference.text.sh @@ -184,9 +184,6 @@ __object_id:: the filesystem database and ensured by the core). Note: Double slashes ("//") will not be fixed and result in an error. -__self:: - DEPRECATED: Same as __object_name, do not use anymore, use __object_name instead. - Will be removed in cdist 2.1. __object_name:: The full qualified name of the current object. Available for: type manifest, type explorer, type gencode diff --git a/lib/cdist/core/code.py b/lib/cdist/core/code.py index 2ffef9cf..fa1ed3c1 100644 --- a/lib/cdist/core/code.py +++ b/lib/cdist/core/code.py @@ -103,7 +103,6 @@ class Code(object): '__object': cdist_object.absolute_path, '__object_id': cdist_object.object_id, '__object_name': cdist_object.name, - '__self': cdist_object.name, }) return self.local.run_script(script, env=env, return_output=True) diff --git a/lib/cdist/core/manifest.py b/lib/cdist/core/manifest.py index 4b798883..5faeccd1 100644 --- a/lib/cdist/core/manifest.py +++ b/lib/cdist/core/manifest.py @@ -96,7 +96,6 @@ class Manifest(object): '__object': cdist_object.absolute_path, '__object_id': cdist_object.object_id, '__object_name': cdist_object.name, - '__self': cdist_object.name, '__type': cdist_object.cdist_type.absolute_path, '__cdist_manifest': script, }) diff --git a/lib/cdist/test/code/__init__.py b/lib/cdist/test/code/__init__.py index dc701cce..8a8583d7 100644 --- a/lib/cdist/test/code/__init__.py +++ b/lib/cdist/test/code/__init__.py @@ -78,7 +78,6 @@ class CodeTestCase(test.CdistTestCase): self.assertEqual(output_dict['__object'], self.cdist_object.absolute_path) self.assertEqual(output_dict['__object_id'], self.cdist_object.object_id) self.assertEqual(output_dict['__object_name'], self.cdist_object.name) - self.assertEqual(output_dict['__self'], self.cdist_object.name) def test_run_gencode_remote_environment(self): output_string = self.code.run_gencode_remote(self.cdist_object) @@ -94,7 +93,6 @@ class CodeTestCase(test.CdistTestCase): self.assertEqual(output_dict['__object'], self.cdist_object.absolute_path) self.assertEqual(output_dict['__object_id'], self.cdist_object.object_id) self.assertEqual(output_dict['__object_name'], self.cdist_object.name) - self.assertEqual(output_dict['__self'], self.cdist_object.name) def test_transfer_code_remote(self): self.cdist_object.code_remote = self.code.run_gencode_remote(self.cdist_object) diff --git a/lib/cdist/test/code/fixtures/conf/type/__dump_environment/gencode-local b/lib/cdist/test/code/fixtures/conf/type/__dump_environment/gencode-local index ed1265c9..771894fb 100755 --- a/lib/cdist/test/code/fixtures/conf/type/__dump_environment/gencode-local +++ b/lib/cdist/test/code/fixtures/conf/type/__dump_environment/gencode-local @@ -6,4 +6,3 @@ echo "echo __type: $__type" echo "echo __object: $__object" echo "echo __object_id: $__object_id" echo "echo __object_name: $__object_name" -echo "echo __self: $__self" diff --git a/lib/cdist/test/manifest/__init__.py b/lib/cdist/test/manifest/__init__.py index a188c788..a9846b1d 100644 --- a/lib/cdist/test/manifest/__init__.py +++ b/lib/cdist/test/manifest/__init__.py @@ -101,7 +101,6 @@ class ManifestTestCase(test.CdistTestCase): self.assertEqual(output_dict['__object'], cdist_object.absolute_path) self.assertEqual(output_dict['__object_id'], cdist_object.object_id) self.assertEqual(output_dict['__object_name'], cdist_object.name) - self.assertEqual(output_dict['__self'], cdist_object.name) def test_debug_env_setup(self): self.log.setLevel(logging.DEBUG)