mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-06-14 16:44:22 +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>
|
||||
<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]);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user