Objective: Keep fleas out of the house

Which of the following solutions is more sound in terms of naive physics reasoning?

Options: 1). If you have a flea infestation, you can spray rosemary spray around the areas that they are and it will repel the fleas. 2). Using diatomaceous earth , sprinkle around the house but be sure to wear a mask. Don't inhale it. After a couple days you can vacuum it up.
1).