Changeset 1321
- Timestamp:
- 01/25/07 12:30:49 (6 years ago)
- File:
-
- 1 edited
-
ccsd/trunk/crcnetd/_utils/ccsd_cfengine.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ccsd/trunk/crcnetd/_utils/ccsd_cfengine.py
r1311 r1321 870 870 commit = 0 871 871 if session.changeset == 0: 872 session.begin("Removing keys for %s" % (host["host_name"])) 872 session.begin("Removing configuration and keys for deleted host: %s" % 873 (host["host_name"])) 873 874 commit = 1 874 875 875 876 try: 877 # Remove SSH Keys 876 878 base = "%s/sshkeys" % session.revision.getConfigBase() 877 ensureDirExists("%s/%s" % (base, host["host_name"]))878 session.revision._checkForModified(base)879 879 client.svn_client_delete(["%s/%s" % (base, host["host_name"])], True, 880 880 session.revision.ctx, session.revision.pool) 881 882 base = "%s/../ppkeys" % session.revision.getConfigBase() 883 884 client.svn_client_delete(["%s/root-%s.priv" % (base, host["ip_address"])], True, 885 session.revision.ctx, session.revision.pool) 886 887 client.svn_client_delete(["%s/root-%s.pub" % (base, host["ip_address"])], True, 881 882 # Remove CFengine Keys 883 base = "%s/ppkeys" % session.revision.getWorkingDir() 884 client.svn_client_delete(["%s/root-%s.priv" % 885 (base, host["ip_address"])], True, session.revision.ctx, 886 session.revision.pool) 887 client.svn_client_delete(["%s/root-%s.pub" % 888 (base, host["ip_address"])], True, session.revision.ctx, 889 session.revision.pool) 890 891 # Remove Configuration 892 base = "%s/hosts" % session.revision.getConfigBase() 893 client.svn_client_delete(["%s/%s" % (base, host["host_name"])], True, 888 894 session.revision.ctx, session.revision.pool) 889 895 except: 890 (type, value, tb) = sys.exc_info() 891 log_error("Failed to remove keys for %s! - %s" % \ 892 (host["host_name"], value)) 893 # Rollback any changes 894 if commit == 1: 895 session.rollback() 896 return False 896 log_error("Failed to remove all configuration/keys for %s!" % 897 host["host_name"], sys.exc_info()) 897 898 898 899 # Commit changeset if necessary … … 901 902 902 903 return True 903 904 904 905 905 catchEvent("hostnameChanged")
Note: See TracChangeset
for help on using the changeset viewer.
