my $head = "# --- BEGIN PVE ---\n";
my $tail = "# --- END PVE ---\n";
my $perms = $options{perms};
+ $data .= "\n" if $data && $data !~ m/.*?\n$/;
if (!$self->ct_file_exists($file)) {
$self->ct_file_set_contents($file, $head.$data.$tail, $perms) if $data;