Skip to content

Commit

Permalink
mark lxc-clone & lxc-start-ephemeral as deprecated
Browse files Browse the repository at this point in the history
- add deprecation not to man pages
- print deprecation info to stderr when the executables are invoked

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
  • Loading branch information
Christian Brauner committed Feb 24, 2016
1 parent 55290b8 commit 2ae6732
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
3 changes: 2 additions & 1 deletion doc/lxc-clone.sgml.in
Expand Up @@ -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>

Expand Down
2 changes: 1 addition & 1 deletion doc/lxc-start-ephemeral.sgml.in
Expand Up @@ -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>
Expand Down
15 changes: 12 additions & 3 deletions src/lxc/lxc-start-ephemeral.in
Expand Up @@ -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

Expand All @@ -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"),
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions src/lxc/lxc_clone.c
Expand Up @@ -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]);

Expand Down

0 comments on commit 2ae6732

Please sign in to comment.