Commit 2ae6732f by Christian Brauner

mark lxc-clone & lxc-start-ephemeral as deprecated

- add deprecation not to man pages - print deprecation info to stderr when the executables are invoked Signed-off-by: 's avatarChristian Brauner <christian.brauner@mailbox.org>
parent 55290b83
......@@ -278,7 +278,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<refsect1>
<title>Notes</title>
<para>
<command>lxc-clone</command> is superseded by <command>lxc-copy</command>.
<command>lxc-clone</command> is deprecated in favor of
<command>lxc-copy</command>.
</para>
</refsect1>
......
......@@ -230,7 +230,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<refsect1>
<title>Notes</title>
<para>
<command>lxc-start-ephemeral</command> is superseded by
<command>lxc-start-ephemeral</command> is deprecated in favor of
<command>lxc-copy</command>.
</para>
</refsect1>
......
......@@ -36,8 +36,14 @@ import tempfile
_ = gettext.gettext
gettext.textdomain("lxc-start-ephemeral")
# Other functions
def printstderr(*args):
print("lxc-start-ephemeral is deprecated in favor of lxc-copy\n",
*args, file=sys.stderr)
def randomMAC():
import random
......@@ -61,6 +67,9 @@ def get_rundir():
raise Exception("Unable to find a runtime directory")
# Inform that lxc-start-ephemeral is deprecated
printstderr()
# Begin parsing the command line
parser = argparse.ArgumentParser(description=_(
"LXC: Start an ephemeral container"),
......@@ -120,11 +129,11 @@ parser.add_argument("--version", action="version", version=lxc.version)
args = parser.parse_args()
## Check that -d and CMD aren't used at the same time
# Check that -d and CMD aren't used at the same time
if args.command and args.daemon:
parser.error(_("You can't use -d and a command at the same time."))
## Check that -k isn't used with -s tmpfs
# Check that -k isn't used with -s tmpfs
if not args.storage_type:
if args.keep_data:
args.storage_type = "dir"
......
......@@ -121,6 +121,8 @@ int main(int argc, char *argv[])
int c;
bool ret;
fprintf(stderr, "lxc-clone is deprecated in favor of lxc-copy.\n\n");
if (argc < 3)
usage(argv[0]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment