mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-06-15 21:11:50 +00:00
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: Christian Brauner <christian.brauner@mailbox.org>
This commit is contained in:
parent
55290b8333
commit
2ae6732f6b
@ -278,7 +278,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
<para>
|
<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>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
|
||||||
|
@ -230,7 +230,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|||||||
<refsect1>
|
<refsect1>
|
||||||
<title>Notes</title>
|
<title>Notes</title>
|
||||||
<para>
|
<para>
|
||||||
<command>lxc-start-ephemeral</command> is superseded by
|
<command>lxc-start-ephemeral</command> is deprecated in favor of
|
||||||
<command>lxc-copy</command>.
|
<command>lxc-copy</command>.
|
||||||
</para>
|
</para>
|
||||||
</refsect1>
|
</refsect1>
|
||||||
|
@ -36,8 +36,14 @@ import tempfile
|
|||||||
_ = gettext.gettext
|
_ = gettext.gettext
|
||||||
gettext.textdomain("lxc-start-ephemeral")
|
gettext.textdomain("lxc-start-ephemeral")
|
||||||
|
|
||||||
|
|
||||||
# Other functions
|
# Other functions
|
||||||
|
|
||||||
|
|
||||||
|
def printstderr(*args):
|
||||||
|
print("lxc-start-ephemeral is deprecated in favor of lxc-copy\n",
|
||||||
|
*args, file=sys.stderr)
|
||||||
|
|
||||||
|
|
||||||
def randomMAC():
|
def randomMAC():
|
||||||
import random
|
import random
|
||||||
|
|
||||||
@ -61,6 +67,9 @@ def get_rundir():
|
|||||||
raise Exception("Unable to find a runtime directory")
|
raise Exception("Unable to find a runtime directory")
|
||||||
|
|
||||||
|
|
||||||
|
# Inform that lxc-start-ephemeral is deprecated
|
||||||
|
printstderr()
|
||||||
|
|
||||||
# Begin parsing the command line
|
# Begin parsing the command line
|
||||||
parser = argparse.ArgumentParser(description=_(
|
parser = argparse.ArgumentParser(description=_(
|
||||||
"LXC: Start an ephemeral container"),
|
"LXC: Start an ephemeral container"),
|
||||||
@ -120,11 +129,11 @@ parser.add_argument("--version", action="version", version=lxc.version)
|
|||||||
|
|
||||||
args = parser.parse_args()
|
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:
|
if args.command and args.daemon:
|
||||||
parser.error(_("You can't use -d and a command at the same time."))
|
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 not args.storage_type:
|
||||||
if args.keep_data:
|
if args.keep_data:
|
||||||
args.storage_type = "dir"
|
args.storage_type = "dir"
|
||||||
|
@ -121,6 +121,8 @@ int main(int argc, char *argv[])
|
|||||||
int c;
|
int c;
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
||||||
|
fprintf(stderr, "lxc-clone is deprecated in favor of lxc-copy.\n\n");
|
||||||
|
|
||||||
if (argc < 3)
|
if (argc < 3)
|
||||||
usage(argv[0]);
|
usage(argv[0]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user