From 062e9c8c2ece4fceaff3446141b9da68e4a5db13 Mon Sep 17 00:00:00 2001 From: David Boucha Date: Mon, 19 Nov 2012 15:01:47 -0700 Subject: [PATCH] Add migrate.py --- salt/utils/migrate.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 salt/utils/migrate.py diff --git a/salt/utils/migrate.py b/salt/utils/migrate.py new file mode 100644 index 0000000000..bf8d42a02a --- /dev/null +++ b/salt/utils/migrate.py @@ -0,0 +1,28 @@ +''' +Migration tools +''' +# import +import os.path + +def paths(master_or_minion = 'minion'): + ''' + Migrate old minion and master file paths to new ones. + ''' + oldsock_dir = '/var/run/salt' + newsock_dir = '/var/run/salt/{0}'.format(master_or_minion) + + oldpki_dir = '/etc/salt/pki' + newpki_dir = '/etc/salt/pki/{0}'.format(master_or_minion) + + oldcache_dir = '/var/cache/salt' + newcache_dir = '/var/cache/salt/{0}'.format(master_or_minion) + + if not os.path.exists(newsock_dir): + print 'migrate sock stuff' + + if not os.path.exists(newpki_dir): + print 'migrate pki stuff' + + if not os.path.exists(newcache_dir): + print 'migrate cache stuff' +