Bug #1577

Handle non existing personality directories/files

Added by Kostas Papadimitriou over 9 years ago. Updated over 9 years ago.

Status:Closed Start date:10/26/2011
Priority:High Due date:
Assignee:Nikos Skalkotos % Done:

0%

Category:- Spent time: -
Target version:v0.1.3

Description

Setting personality content to paths that don't exist in selected image causes personality script to fail.

HELPER: 2011:10:26-15:52:13.432469694   File "/usr/lib/snf-image-helper/tasks/40EnforcePersonality", line 49, in main
HELPER: 2011:10:26-15:52:13.435545011     newfile = open(real_path, 'w')
HELPER: 2011:10:26-15:52:13.436440354 IOError: [Errno 2] No such file or directory: u'/tmp/target.9qEOnP/root/.ssh/authorized_keys'
HELPER: 2011:10:26-15:52:13.439786114 run-parts: /usr/lib/snf-image-helper/tasks/40EnforcePersonality exited with return code 1

History

#1 Updated by Vangelis Koukis over 9 years ago

  • Assignee set to Constantinos Venetsanopoulos
  • Target version set to v0.1.3

#2 Updated by Vangelis Koukis over 9 years ago

  • Status changed from New to Assigned

A suggestion, untested:

parentdir = os.path.dirname(filename)
if not os.path.exists(parentdir):
    os.makedirs(parentdir)

#3 Updated by Nikos Skalkotos over 9 years ago

  • Status changed from Assigned to Feedback

fixed in commit 22a2e378828a7e9597fd199a7affde35e3c2f91b

#4 Updated by Nikos Skalkotos over 9 years ago

  • Assignee changed from Constantinos Venetsanopoulos to Nikos Skalkotos

#5 Updated by Nikos Skalkotos over 9 years ago

  • Status changed from Feedback to Closed

Also available in: Atom PDF